Skip to content

make bundle_name not nullable #47592

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

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open

make bundle_name not nullable #47592

wants to merge 51 commits into from

Conversation

gyli
Copy link
Collaborator

@gyli gyli commented Mar 11, 2025

Change bundle_name in dag not nullable and prepopulate the value in the migration: #46734

@boring-cyborg boring-cyborg bot added the area:db-migrations PRs with DB migration label Mar 11, 2025
remove migration query

Co-authored-by: Ephraim Anierobi <[email protected]>
@gyli gyli requested a review from potiuk as a code owner March 15, 2025 22:24
@gyli
Copy link
Collaborator Author

gyli commented May 5, 2025

Hi @ephraimbuddy @jedcunningham Do you think this PR looks good already, or you think more testing needs to be done?

@ephraimbuddy
Copy link
Contributor

Hi @ephraimbuddy @jedcunningham Do you think this PR looks good already, or you think more testing needs to be done?

Since Airflow 3 has been released, we should update the PR with new migration file instead of editing the add-dagbundlemodel migration file. Sorry that it didn't make it to 3.0.0

@gyli
Copy link
Collaborator Author

gyli commented May 6, 2025

PR is updated to use new migration file, as 3.0 is rolled out.

…undle_name_not_nullable.py

Co-authored-by: Ephraim Anierobi <[email protected]>
…undle_name_not_nullable.py


Update downgrade

Co-authored-by: Ephraim Anierobi <[email protected]>
@ephraimbuddy
Copy link
Contributor

I noticed a pattern where you have to add DagModel with the bundle_name explicitly despite that there's dag.sync_to_db next to it. I feel something is wrong somewhere for us to do that

Hi @ephraimbuddy, This is because DagModel.bundle_name does not have a not-null default value. I think ideally, bulk_write_to_db or sync_to_db can be updated to handle DagModel and DagBundleModel insertion, while I am afraid this is too much to be added to this PR, as these these methods are used in other unrelated unit tests and components as well. I can probably leave a TODO comment and improve this in another PR. What do you think?

Another potential approach is to set dags-folder as the default value in the model. While I don't see a similar case with hard-coded string value in other models, so I assume we don't want to this.

Improving it in another PR is good too.

@gyli gyli requested review from jedcunningham and uranusjr June 30, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

4 participants