Skip to content

Commit

Permalink
fix: only generate Airflow task for BigEye if monitoring enabled in t…
Browse files Browse the repository at this point in the history
…he metadata (#6326)
  • Loading branch information
kik-kik authored Oct 10, 2024
1 parent e4ff38b commit 221cd9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bigquery_etl/query_scheduling/generate_airflow_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def get_dags(project_id, dags_config, sql_dir=None):
dag_collection=dag_collection,
)
)
tasks.append(bigeye_task)

if bigeye_task.monitoring_enabled:
tasks.append(bigeye_task)

if CHECKS_FILE in files:
checks_file = os.path.join(root, CHECKS_FILE)
Expand Down
5 changes: 5 additions & 0 deletions bigquery_etl/query_scheduling/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ class Task:
node_selector: Optional[Dict[str, str]] = attr.ib(None)
startup_timeout_seconds: Optional[int] = attr.ib(None)
secrets: Optional[List[Secret]] = attr.ib(None)
monitoring_enabled: Optional[bool] = attr.ib(False)

@property
def task_key(self):
Expand Down Expand Up @@ -489,6 +490,10 @@ def of_query(cls, query_file, metadata=None, dag_collection=None):
# expose secret config
task_config["secrets"] = metadata.scheduling.get("secrets", [])

# to determine if BigEye task should be generated
if metadata.monitoring:
task_config["monitoring_enabled"] = metadata.monitoring.enabled

# data processed in task should be published
if metadata.is_public_json():
task_config["public_json"] = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ scheduling:
dag_name: "bqetl_core"
depends_on_past: true
arguments: ["--date", "{{ds}}"]
monitoring:
enabled: true

1 comment on commit 221cd9b

@dataops-ci-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration report for "fix: only generate Airflow task for BigEye if monitoring enabled in the metadata (#6326)"

sql.diff

No content detected.

Please sign in to comment.