get_df
laktory.dlt.get_df
ยค
get_df(df_wrapper)
When executed in debug mode (ref dlt.is_debug
), executes and returns
the output dataframe of a function decorated with @dlt.table
or
@dlt.view
. Returns None when is_debug()
is False
.
This method is not supported when a table using DLT views as input.
RETURNS | DESCRIPTION |
---|---|
SparkDataFrame
|
Output dataframe |
Examples:
from laktory import dlt
dlt.spark = spark
def define_table():
@dlt.table(name="stock_prices")
def get_df():
df = spark.createDataFrame([[1.0, 1.1, 0.98]])
return df
return get_df
wrapper = define_table()
df = dlt.get_df(wrapper)
display(df)
Source code in laktory/dlt/__init__.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|