Skip to content

Commit 7210fc8

Browse files
refactor load_pricing_data for explicit asset dependency
1 parent 463f283 commit 7210fc8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

card_data/pipelines/defs/load/load_pricing_data.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import dagster as dg
2+
import polars as pl
23
from dagster import RetryPolicy, Backoff
34
from sqlalchemy.exc import OperationalError
45
from ..extract.extract_pricing_data import build_dataframe
@@ -7,17 +8,15 @@
78

89

910
@dg.asset(
10-
deps=[build_dataframe],
1111
kinds={"Supabase", "Postgres"},
1212
retry_policy=RetryPolicy(max_retries=3, delay=2, backoff=Backoff.EXPONENTIAL),
1313
)
14-
def load_pricing_data() -> None:
14+
def load_pricing_data(build_pricing_dataframe: pl.DataFrame) -> None:
1515
database_url: str = fetch_secret()
1616
table_name: str = "staging.pricing_data"
1717

18-
df = build_dataframe()
1918
try:
20-
df.write_database(
19+
build_pricing_dataframe.write_database(
2120
table_name=table_name, connection=database_url, if_table_exists="replace"
2221
)
2322
print(colored(" ✓", "green"), f"Data loaded into {table_name}")

0 commit comments

Comments
 (0)