We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f1997a5 commit fa5759eCopy full SHA for fa5759e
1 file changed
hts_dagster_sample/assets/postgres_workflow.py
@@ -13,10 +13,10 @@ def generate_users():
13
return df
14
15
16
-@asset
17
-def update_user_database(generate_users, postgres_db):
+@asset(required_resource_keys={"postgres"}) # Declare postgres as required resource
+def update_user_database(context, generate_users): # Add context, remove postgres_db parameter
18
"""Update PostgreSQL database with user data"""
19
- with postgres_db.get_connection() as conn:
+ with context.resources.postgres.get_connection() as conn: # Use postgres through context
20
# Create table if not exists
21
create_table_sql = """
22
CREATE TABLE IF NOT EXISTS users (
0 commit comments