Visitar URL original
Handle missing/null serialized DAG dependencies by uranusjr · Pull Request #16393 · apache/airflow · GitHub
Skip to content

Handle missing/null serialized DAG dependencies - #16393

Merged
kaxil merged 1 commit into
apache:mainfrom
uranusjr:dag-dependencies-default-empty
Jun 15, 2021
Merged

kaxil merged 1 commit into
apache:mainfrom
uranusjr:dag-dependencies-default-empty

Conversation

@uranusjr

Copy link
Copy Markdown
Member

When a serialized DAG is missing a dag_dependencies field (possible when upgrading), PostgreSQL would return NULL when accessing the field with a JSON function. This value would fail subsequent code, so we need some logic to handle it.

I took the oppertunity to rewrite the entire get_dag_dependencies function to use iterators. This should slightly improve performance.

Fix #16356.

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice. Could you please add a regression test for that and see that it failed before ? I am always suspicious of changes that have no tests :D

@ashb ashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code LGTM.

@github-actions

Copy link
Copy Markdown
Contributor

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions Bot added the full tests needed We need to run full set of tests for this PR to merge label Jun 11, 2021
@uranusjr
uranusjr force-pushed the dag-dependencies-default-empty branch from d969197 to 38831bd Compare June 11, 2021 15:26
@uranusjr

Copy link
Copy Markdown
Member Author

Test added!

@ashb ashb added this to the Airflow 2.1.1 milestone Jun 11, 2021
@potiuk

potiuk commented Jun 12, 2021

Copy link
Copy Markdown
Member

tests failing :(

@uranusjr
uranusjr force-pushed the dag-dependencies-default-empty branch from 38831bd to 9ffe495 Compare June 13, 2021 09:11
@kaxil

kaxil commented Jun 14, 2021

Copy link
Copy Markdown
Member

@uranusjr Pylint failure:

************* Module tests.decorators.test_python
tests/decorators/test_python.py:458:62: E1101: Instance of 'str' has no 'task_id' member (no-member)

Probably rebasing on Master might fix it

When a serialized DAG is missing a "dag_dependencies" field (possible
when upgrading), PostgreSQL would return NULL when accessing the field
with a JSON function. This value would fail subsequent code, so we need
some logic to handle it.
@uranusjr
uranusjr force-pushed the dag-dependencies-default-empty branch from 9ffe495 to 2e3243d Compare June 15, 2021 07:11
@uranusjr

Copy link
Copy Markdown
Member Author

Rebased and now the linter is passing. There are a couple of failures in Helm Chart tests:

FAILED chart/tests/test_ingress_flower.py::IngressFlowerTest::test_should_allow_more_than_one_annotation
FAILED chart/tests/test_limit_ranges.py::LimitRangesTest::test_limit_ranges_template

I have no idea what went wrong; seems like flaky network issues?

@kaxil
kaxil merged commit 0fa4d83 into apache:main Jun 15, 2021
@kaxil

kaxil commented Jun 15, 2021

Copy link
Copy Markdown
Member

Rebased and now the linter is passing. There are a couple of failures in Helm Chart tests:

FAILED chart/tests/test_ingress_flower.py::IngressFlowerTest::test_should_allow_more_than_one_annotation
FAILED chart/tests/test_limit_ranges.py::LimitRangesTest::test_limit_ranges_template

I have no idea what went wrong; seems like flaky network issues?

Yup, ran those tests locally, all green.

============================================================================================== 370 passed in 374.22s (0:06:14) ===============================================================================================

@jhtimmins jhtimmins modified the milestones: Airflow 2.1.1, Airflow 2.2 Jun 16, 2021
@uranusjr
uranusjr deleted the dag-dependencies-default-empty branch November 25, 2021 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:serialization full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exception when root account goes to http://airflow.ordercapital.com/dag-dependencies

5 participants