Skip to content

Commit

Permalink
better assertion handling
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Dec 17, 2024
1 parent 6d11c46 commit 0985ba5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions userCode/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def gleaner_config(context: AssetExecutionContext):

sources = []
names = set()

assert (
len(Lines) > 0
), f"No sitemaps found in sitemap index {REMOTE_GLEANER_SITEMAP}"

for line in Lines:
basename = REMOTE_GLEANER_SITEMAP.removesuffix(".xml")
name = (
Expand Down
6 changes: 3 additions & 3 deletions userCode/test/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from dagster import AssetsDefinition, AssetSpec, SourceAsset


def test_materialize_configs():
def test_materialize_ref_hu02():
instance = DagsterInstance.ephemeral()

assets = load_assets_from_modules([main])
Expand All @@ -34,10 +34,10 @@ def test_materialize_configs():
all_partitions = sources_partitions_def.get_partition_keys(
dynamic_partitions_store=instance
)
assert len(all_partitions) > 0
assert len(all_partitions) > 0, "Partitions were not generated"

result = resolved_job.execute_in_process(
instance=instance, partition_key="ref_hu02_hu02__0"
)

assert result.success
assert result.success, "Job execution failed for partition 'ref_hu02_hu02__0'"

0 comments on commit 0985ba5

Please sign in to comment.