Skip to content

fix(samples): fix column name in DagModel of Airflow workflow to clean up database #6532

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

Merged

Conversation

kosteev
Copy link
Contributor

@kosteev kosteev commented Aug 5, 2021

Description

Fixes #6531

Checklist

@kosteev kosteev requested review from leahecole, rachael-ds and a team as code owners August 5, 2021 12:31
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Aug 5, 2021
@leahecole
Copy link
Collaborator

leahecole commented Aug 5, 2021

(edited) - I see in the issue comment this only affects Airflow 2+. Thanks for the fix!

leahecole
leahecole previously approved these changes Aug 5, 2021
@leahecole leahecole added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 5, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 5, 2021
@leahecole leahecole dismissed their stale review August 5, 2021 16:28

tests not passing - I thought they were

@leahecole
Copy link
Collaborator

Hey @kosteev - I now see tests aren't passing. Are they passing for you locally? (See the Testing Guidelines for instructions on running tests locally)

@kosteev
Copy link
Contributor Author

kosteev commented Aug 5, 2021

@leahecole I've bumped version of apache-airflow in requirements.txt file.

I wasn't able to run locally tests with nox, but I have installed pypi requirements* manually and ran py.test manually, and airflow_db_cleanup_test has passed successfully.

Can you, please trigger Kokoro. I believe it has to be triggered manually, as I do not see it is executed automatically.

@kosteev kosteev requested a review from leahecole August 5, 2021 21:06
@dandhlee dandhlee added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 6, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 6, 2021
@kosteev
Copy link
Contributor Author

kosteev commented Aug 6, 2021

I see it failed again. Trying actually to run all tests locally and fix.

@kosteev
Copy link
Contributor Author

kosteev commented Aug 6, 2021

Ok.
I was able to setup local environment and run tests with nox.

I have updated constraints.txt file to have constraints (I didn't realized we have it) to Airflow 2.1.2 constraints (as I bumped it in requirements.txt) and it was the reason for failing tests with new Airflow version. Now hadoop_tutorial_test.test_dag_import passes for me locally.

Please, run Kokoro again.

@kosteev
Copy link
Contributor Author

kosteev commented Aug 6, 2021

Side question: can I get permissions for running Kokoro CI tests for this specific folder?

@leahecole leahecole added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 6, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 6, 2021
@kosteev
Copy link
Contributor Author

kosteev commented Aug 6, 2021

New DataflowTemplatedJobStartOperator requires apache.beam extra, I have added it and tests are passing.
PTAL.

@leahecole
Copy link
Collaborator

leahecole commented Aug 6, 2021

ready for review 2 when you are @dandhlee 😄

@@ -130,7 +130,7 @@
"keep_last_group_by": None
}, {
"airflow_db_model": DagModel,
"age_check_column": DagModel.last_scheduler_run,
"age_check_column": DagModel.last_parsed_time, # prior to Airflow 2.0.2 this column was named last_scheduler_run
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 for mentioning this!

Copy link
Collaborator

@dandhlee dandhlee left a comment

Choose a reason for hiding this comment

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

LGTM!

@dandhlee dandhlee changed the title Fix column name in DagModel of Airflow workflow to clean up database fix(samples): fix column name in DagModel of Airflow workflow to clean up database Aug 6, 2021
@dandhlee dandhlee added the automerge Merge the pull request once unit tests and other checks pass. label Aug 6, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 9fa2a7c into GoogleCloudPlatform:master Aug 6, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Airflow DB clean up DAG not working with recent versions
4 participants