Skip to content

Commit ba6f999

Browse files
updating soda data check asset
1 parent 0bf8339 commit ba6f999

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

card_data/pipelines/defs/load/load_data.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@dg.asset(
1616
deps=[extract_series_data],
1717
kinds={"Supabase", "Postgres"},
18+
name="load_series_data",
1819
retry_policy=RetryPolicy(max_retries=3, delay=2, backoff=Backoff.EXPONENTIAL)
1920
)
2021
def load_series_data() -> None:
@@ -32,9 +33,12 @@ def load_series_data() -> None:
3233
raise
3334

3435

35-
@dg.asset(deps=[load_series_data], kinds={"Soda"}, key_prefix=["staging"], name="series")
36+
@dg.asset(
37+
deps=[load_series_data],
38+
kinds={"Soda"},
39+
name="quality_checks_series"
40+
)
3641
def data_quality_check_on_series() -> None:
37-
# Set working directory to where this file is located
3842
current_file_dir = Path(__file__).parent
3943
print(f"Setting cwd to: {current_file_dir}")
4044

@@ -59,12 +63,14 @@ def data_quality_check_on_series() -> None:
5963
if result.stderr:
6064
print(result.stderr)
6165

66+
if result.returncode != 0:
67+
raise Exception(f"Soda data quality checks failed with return code {result.returncode}")
68+
6269

6370
@dg.asset(
6471
deps=[extract_set_data],
6572
kinds={"Supabase", "Postgres"},
66-
key_prefix=["staging"],
67-
name="sets",
73+
name="load_set_data",
6874
retry_policy=RetryPolicy(max_retries=3, delay=2, backoff=Backoff.EXPONENTIAL)
6975
)
7076
def load_set_data() -> None:
@@ -85,8 +91,7 @@ def load_set_data() -> None:
8591
@dg.asset(
8692
deps=[create_card_dataframe],
8793
kinds={"Supabase", "Postgres"},
88-
key_prefix=["staging"],
89-
name="cards",
94+
name="load_card_data",
9095
retry_policy=RetryPolicy(max_retries=3, delay=2, backoff=Backoff.EXPONENTIAL)
9196
)
9297
def load_card_data() -> None:

0 commit comments

Comments
 (0)