Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure back_populates between DagScheduleDatasetReference.dag and DagModel.schedule_dataset_references #39392

Conversation

Taragolis
Copy link
Contributor

We have an annoying warning about conflicts with relationship between DagScheduleDatasetReference.dag and DagModel.schedule_dataset_references

Resetting the DB

DB: postgresql+psycopg2://postgres:***@postgres/airflow
[2024-05-03T09:37:44.023+0000] {db.py:1651} INFO - Dropping tables that exist
[2024-05-03T09:37:44.399+0000] {migration.py:216} INFO - Context impl PostgresqlImpl.
[2024-05-03T09:37:44.399+0000] {migration.py:219} INFO - Will assume transactional DDL.
[2024-05-03T09:37:44.422+0000] {migration.py:216} INFO - Context impl PostgresqlImpl.
[2024-05-03T09:37:44.422+0000] {migration.py:219} INFO - Will assume transactional DDL.
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running stamp_revision  -> 677fdbb7fc54
/opt/airflow/airflow/utils/db.py:133 SAWarning: relationship 'DagModel.schedule_dataset_references' will copy column dag.dag_id to column dag_schedule_dataset_reference.dag_id, which conflicts with relationship(s): 'DagScheduleDatasetReference.dag' (copies dag.dag_id to dag_schedule_dataset_reference.dag_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="dag"' to the 'DagModel.schedule_dataset_references' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted.

Database has been reset

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

…and `DagModel.schedule_dataset_references`
@Taragolis Taragolis added the full tests needed We need to run full set of tests for this PR to merge label May 3, 2024
@Taragolis Taragolis added this to the Airflow 2.9.2 milestone May 3, 2024
Copy link
Contributor

@dirrao dirrao left a comment

Choose a reason for hiding this comment

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

LGTM

@Taragolis Taragolis merged commit 575c11e into apache:main May 4, 2024
68 checks passed
@Taragolis Taragolis deleted the back-populates-dagmodel-schedule-dataset-reference branch May 4, 2024 22:42
@utkarsharma2 utkarsharma2 added type:improvement Changelog: Improvements type:misc/internal Changelog: Misc changes that should appear in change log and removed type:improvement Changelog: Improvements labels Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants