File tree Expand file tree Collapse file tree 1 file changed +33
-5
lines changed
Expand file tree Collapse file tree 1 file changed +33
-5
lines changed Original file line number Diff line number Diff line change 1- from dagster import Definitions
2- from .resources .database import postgres_db , duckdb_db
1+ from dagster import Definitions , load_assets_from_modules
2+ from hts_dagster_sample .assets import (
3+ duckdb_workflow ,
4+ pandas_workflow ,
5+ polars_workflow ,
6+ postgres_workflow ,
7+ sales_workflow
8+ )
9+ from hts_dagster_sample .resources .database import postgres_db , duckdb_db
310
11+ # Load assets from modules using load_assets_from_modules
12+ duckdb_assets = load_assets_from_modules ([duckdb_workflow ])
13+ pandas_assets = load_assets_from_modules ([pandas_workflow ])
14+ polars_assets = load_assets_from_modules ([polars_workflow ])
15+ postgres_assets = load_assets_from_modules ([postgres_workflow ])
16+ sales_assets = load_assets_from_modules ([sales_workflow ])
17+
18+ # Combine all assets
19+ all_assets = [
20+ * duckdb_assets ,
21+ * pandas_assets ,
22+ * polars_assets ,
23+ * postgres_assets ,
24+ * sales_assets ,
25+ ]
26+
27+ # Define your Dagster definitions with the resources
428defs = Definitions (
5- assets = [], # Assets are auto-discovered
29+ assets = all_assets ,
630 resources = {
7- "postgres_db" : postgres_db ,
8- "duckdb_db" : duckdb_db ,
31+ "duckdb_db" : duckdb_db .configured ({
32+ "path" : ":memory:" # or a specific file path
33+ }),
34+ "postgres" : postgres_db .configured ({
35+ "conn_string" : "postgresql://username:password@host:5432/dbname"
36+ })
937 }
1038)
You can’t perform that action at this time.
0 commit comments