Skip to content

Add bundle_name attribute to DAG and update PythonDagImporter to set it#68621

Closed
bramhanandlingala wants to merge 2 commits into
apache:mainfrom
bramhanandlingala:feature-add-dag-bundle-name
Closed

Add bundle_name attribute to DAG and update PythonDagImporter to set it#68621
bramhanandlingala wants to merge 2 commits into
apache:mainfrom
bramhanandlingala:feature-add-dag-bundle-name

Conversation

@bramhanandlingala

Copy link
Copy Markdown
Contributor

What

Add a bundle_name attribute to DAG objects and populate it when DAGs are imported from a bundle.

Why

This makes it possible to identify which DAG bundle a DAG originated from and enables bundle-specific DAG policies.

Example:

@hookimpl
def dag_policy(dag):
    if dag.bundle_name == "example_dags":
        return

    if dag.bundle_name == "special_dags":
        ...

Changes

  • Added bundle_name field to DAG.
  • Set dag.bundle_name during DAG import.
  • Added tests to verify imported DAGs receive the configured bundle name.

Fixes #68575

@jroachgolf84

Copy link
Copy Markdown
Collaborator

@bramhanandlingala - I've already opened a PR for this issue, and it was assigned to me. Please feel free to provide a review on it, but no need to duplicate work :)

#68583

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

@jroachgolf84 , Thanks for the heads-up. I wasn't aware there was already an assigned PR for this issue. I'll close my PR to avoid duplicating work and will review #68583 instead. Appreciate the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bundle_name to Dag objects

2 participants