notify_slack
should determine dag_id
on its own
#4884
Labels
💻 aspect: code
Concerns the software code in the repository
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
good first issue
New-contributor friendly
help wanted
Open to participation from the community
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: catalog
Related to the catalog and Airflow DAGs
🔧 tech: airflow
Involves Apache Airflow
Description
Since
common.slack.notify_slack
is an Airflow TaskFlow API@task
, it has access to the context variables: https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/taskflow.html#contextThus, we should be able to have it determine the
dag_id
on its own (via thedag.dag_id
property of thedag
object available for templating).This function will need to be changed to remove the
dag_id
required parameter from the outer function call, adddag: DAG | None = None
at the end of the argument list, and then passdag.dag_id
into thesend_message
call:openverse/catalog/dags/common/slack.py
Lines 421 to 433 in 7f5baa2
The text was updated successfully, but these errors were encountered: