Skip to content

Update airflow_db_cleanup.py to also clean sessions table#10775

Merged
rafalbiegacz merged 2 commits into
GoogleCloudPlatform:mainfrom
apilaskowski:patch-1
Oct 18, 2023
Merged

Update airflow_db_cleanup.py to also clean sessions table#10775
rafalbiegacz merged 2 commits into
GoogleCloudPlatform:mainfrom
apilaskowski:patch-1

Conversation

@apilaskowski

Copy link
Copy Markdown
Contributor

Resolving issue #10774

@apilaskowski apilaskowski requested review from a team as code owners October 17, 2023 17:36
@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: workflows Issues related to the Workflows API. labels Oct 17, 2023
@apilaskowski

Copy link
Copy Markdown
Contributor Author

This change assumes that previous PR #10771 is already merged.
I tested it both on databases with Airflow versions 2.5.3 and 2.6.3.

@apilaskowski

Copy link
Copy Markdown
Contributor Author

@iennae is there something that I should do to unblock this? So it can be released?

@leahecole

Copy link
Copy Markdown
Collaborator

Same as before, ask @rafalbiegacz for review #2!

@leahecole leahecole added api: composer Issues related to the Managed Service for Apache Airflow API. and removed api: workflows Issues related to the Workflows API. labels Oct 18, 2023
@rafalbiegacz rafalbiegacz merged commit ddef2fb into GoogleCloudPlatform:main Oct 18, 2023
@dlevin-doubleverify

dlevin-doubleverify commented Jan 9, 2024

Copy link
Copy Markdown

This change assumes that previous PR #10771 is already merged. I tested it both on databases with Airflow versions 2.5.3 and 2.6.3.

It fails for me on 2.5.3

[2024-01-09, 20:57:37 UTC] {airflow_database_cleanup.py:471} INFO - Deleting sessions...
[2024-01-09, 20:57:37 UTC] {airflow_database_cleanup.py:489} ERROR - (sqlite3.OperationalError) unrecognized token: ":"
[SQL: SELECT * FROM session WHERE expiry < now()::timestamp(0);]
(Background on this error at: https://sqlalche.me/e/14/e3q8)

I'm running it via https://cloud.google.com/composer/docs/composer-2/run-local-airflow-environments

Edit: I also ran it on a "real" environment in Cloud Composer and it fails there as well.

@apilaskowski

Copy link
Copy Markdown
Contributor Author

Hi, I will take a look today. Thank you for observing and sharing that.

@d-levin

d-levin commented Feb 2, 2024

Copy link
Copy Markdown

Hi, I will take a look today. Thank you for observing and sharing that.

@apilaskowski Did you get a chance to look into this? :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: composer Issues related to the Managed Service for Apache Airflow API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants