Skip to content

Conversation

@kukigai
Copy link
Contributor

@kukigai kukigai commented Oct 12, 2020

dagrun operator throws DagRunAlreadyExists if dag has already run on the same execution date.
However, user might need to backfill with reset_dagruns option.
When user submit backfill with reset_dagruns and want to clear previous dag run, dagrun_operator should clear that dag run.

trigger_dag.py (line76) change is required since "dag_run" can be list and if that is the case, "AttributeError: 'list' object has no attribute 'run_id'" is raised instead of DagRunAlreadyExists.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Oct 12, 2020
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.log.info(f"Clearing {self.trigger_dag_id} on {self.execution_date}")
self.log.info("Clearing %s on %s", self.trigger_dag_id, self.execution_date)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
raise DagNotFound("Dag id {} not found in DagModel".format(self.trigger_dag_id))
raise DagNotFound(f"Dag id {self.trigger_dag_id} not found in DagModel"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Comment on lines 120 to 128
Copy link
Member

Choose a reason for hiding this comment

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

Is there any particular reason to introduce this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@turbaszek turbaszek Oct 13, 2020

Choose a reason for hiding this comment

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

I think we can simply import conf and do:

store_serialized_dags=conf.getboolean('core', 'store_serialized_dags')

Copy link
Member

Choose a reason for hiding this comment

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

btw you can actually use settings.STORE_SERIALIZED_DAGS too. This setting (and conf) will however be removed in #11335

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kaxil @turbaszek

I changed it to settings.STORE_SERIALIZED_DAGS for now. When #11335 is finalized, this line also needs to be updated.

Copy link
Member

Choose a reason for hiding this comment

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

Should we add note here that this may be useful for backfill and rerunning tasks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added more description.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@mik-laj mik-laj removed the area:API Airflow's REST/HTTP API label Oct 13, 2020
@potiuk
Copy link
Member

potiuk commented Oct 13, 2020

Hey @kukigai . Can you please rebase this one to latest master. We fixed (hopefully) a problem with queues of jobs for GitHub actions and I think when you rebase, it shoudl run much faster (more info on devlist shortly).

@kukigai
Copy link
Contributor Author

kukigai commented Oct 13, 2020

@potiuk rebased it.

@turbaszek turbaszek merged commit 6c8cf6a into apache:master Oct 14, 2020
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.

5 participants