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 ownersOctober 17, 2023 17:36
@product-auto-labelproduct-auto-labelBot 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
ContributorAuthor

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
ContributorAuthor

@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!

@leahecoleleahecole 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:mainOct 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
ContributorAuthor

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

@d-levin

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@apilaskowski@leahecole@dlevin-doubleverify@d-levin@rafalbiegacz@iennae