28 lines
806 B
Python
28 lines
806 B
Python
import assets
|
|
from dagster_delta import DeltaLakePyarrowIOManager, LocalConfig, WriteMode
|
|
from dagster_polars import PolarsParquetIOManager
|
|
from icecream import install
|
|
from shared.config import APP, STORAGE_DIR
|
|
|
|
import dagster as dg
|
|
|
|
install()
|
|
|
|
definitions = dg.Definitions(
|
|
assets=[
|
|
asset.with_attributes(
|
|
group_names_by_key={asset.key: APP},
|
|
)
|
|
for asset in dg.load_assets_from_modules([assets])
|
|
],
|
|
resources={
|
|
"polars_parquet_io_manager": PolarsParquetIOManager(base_dir=STORAGE_DIR),
|
|
"delta_io_manager": DeltaLakePyarrowIOManager(
|
|
root_uri=STORAGE_DIR,
|
|
storage_options=LocalConfig(),
|
|
mode=WriteMode.overwrite,
|
|
parquet_read_options={"coerce_int96_timestamp_unit": "us"},
|
|
),
|
|
},
|
|
)
|