forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update trigger_timeout column in task_instance table to use UtcDateTi…
…me (apache#44507) * update task instance trigger timeout to utcdatetime * update task instance trigger timeout to utcdatetime * update task instance trigger timeout to utcdatetime * updatng task_instance file * update migration desc * fixing execution api test * adding migration condition to run only for postgresql * fix static check * remove postgresql condition
- Loading branch information
1 parent
3e2b5e2
commit b7df463
Showing
6 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...low/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
""" | ||
update trigger_timeout column in task_instance table to UTC. | ||
Revision ID: 038dc8bc6284 | ||
Revises: e229247a6cb1 | ||
Create Date: 2024-11-30 10:47:17.542690 | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
from airflow.migrations.db_types import TIMESTAMP | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "038dc8bc6284" | ||
down_revision = "e229247a6cb1" | ||
branch_labels = None | ||
depends_on = None | ||
airflow_version = "3.0.0" | ||
|
||
|
||
def upgrade(): | ||
"""Apply update task instance trigger timeout to utcdatetime.""" | ||
with op.batch_alter_table("task_instance", schema=None) as batch_op: | ||
batch_op.alter_column( | ||
"trigger_timeout", | ||
existing_type=sa.DateTime(), | ||
type_=TIMESTAMP(timezone=True), | ||
existing_nullable=True, | ||
) | ||
|
||
|
||
def downgrade(): | ||
"""Unapply update task instance trigger timeout to utcdatetime.""" | ||
with op.batch_alter_table("task_instance", schema=None) as batch_op: | ||
batch_op.alter_column( | ||
"trigger_timeout", | ||
existing_type=TIMESTAMP(timezone=True), | ||
type_=sa.DateTime(), | ||
existing_nullable=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
95b59583f58fa1dad1ae07cac699b0a72143abae9beaa33f79c3ff0f24e52c7d | ||
8f2fd91375c546b297490e701dc3853d7ba53c7cd1422ed7f7e57b9ac86f6eca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters