Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tags to jobs #28

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dags_tests/compile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

def test_compiles():
job_names = [d.name for d in list(defs.get_all_job_defs())]
assert len(job_names) == 21
assert len(job_names) == 22
15 changes: 11 additions & 4 deletions nwp/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def build_config_on_runtime(model: str, run: str, delay: int = 0) -> dict:
"config": build_config_on_runtime(model, r, delay)},
"upload_model_files_to_hf": {
"config": build_config_on_runtime(model, r, delay)},
}}
}},
tags={"source": "icon"}
)
match (delay, r):
case (0, "00"):
Expand Down Expand Up @@ -89,7 +90,10 @@ def CAMSDailyPartitionConfig(start: dt.datetime, _end: dt.datetime) -> dict[str,
return {"ops": {"fetch_cams_forecast_for_day": {"config": json.loads(config.json())}}}


@dagster.job(config=CAMSDailyPartitionConfig)
@dagster.job(
config=CAMSDailyPartitionConfig,
tags={"source": "cams"}
)
def cams_daily_archive() -> None:
"""Download CAMS data for a given day."""
fetch_cams_forecast_for_day()
Expand All @@ -107,7 +111,10 @@ def CAMSEUDailyPartitionConfig(start: dt.datetime, _end: dt.datetime) -> dict[st
return {"ops": {"fetch_cams_eu_forecast_for_day": {"config": json.loads(config.json())}}}


@dagster.job(config=CAMSEUDailyPartitionConfig)
@dagster.job(
config=CAMSEUDailyPartitionConfig,
tags={"source": "cams"}
)
def cams_eu_daily_archive() -> None:
"""Download CAMS data for a given day."""
fetch_cams_eu_forecast_for_day()
Expand Down Expand Up @@ -182,7 +189,7 @@ def partitioned_config_func(partition_key: str) -> dict[str, Any]:
@dagster.job(
name="ecmwf_daily_local_archive" if loc=="uk" else f"ecmwf_{loc}_daily_archive",
config=config,
tags={"area": loc},
tags={"source": "ecmwf", "area": loc},
)
def ecmwf_daily_partitioned_archive() -> None:
"""Download and convert NWP data using the consumer according to input config."""
Expand Down