You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "vatsrahul1001 (via GitHub)" <gi...@apache.org> on 2024/11/30 11:10:03 UTC

[PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

vatsrahul1001 opened a new pull request, #44507:
URL: https://github.com/apache/airflow/pull/44507

   closes: https://github.com/apache/airflow/issues/44421
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1881824870


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1881680758


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   But we want to now change it to a datetime with timezone info, so we need to update all the DBs to use the timezone info



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy merged PR #44507:
URL: https://github.com/apache/airflow/pull/44507


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1878242836


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   cc @ephraimbuddy our in-house DB migration expert



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on PR #44507:
URL: https://github.com/apache/airflow/pull/44507#issuecomment-2531418455

   > LGTM +1 @kaxil?
   
   Does this look good to you, @kaxil?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1878242322


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   Hmm why this for Postgres?
   
   You could just use `from airflow.migrations.db_types import TIMESTAMP`
   
   https://github.com/apache/airflow/blob/5079f7d8557ac2334aadfdbb9ce209199116fb06/airflow/migrations/db_types.py#L68



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1881670128


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   Yes. You should remove the 'if postgresql' because this should affect all DBs and also you should import TIMESTAMP from db_types. `from airflow.migrations.db_types import TIMESTAMP`. See #44221 where I had to import and use it too



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1881677703


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   I did put a if condition for `postgresql` as in Mysql and Sqlite column is stored  as `DATETIME` only.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1881677175


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   ```suggestion
       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,
               )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1878245454


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   For reference: Ephraim fixed a lot of inconsistencies between ORM and DB migrations in https://github.com/apache/airflow/pull/44221



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #44507:
URL: https://github.com/apache/airflow/pull/44507#discussion_r1881664789


##########
airflow/migrations/versions/0051_3_0_0_update_task_instance_trigger_timeout_to_utcdatetime.py:
##########
@@ -0,0 +1,68 @@
+#
+# 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
+
+from alembic import op
+from sqlalchemy.dialects import postgresql
+
+import airflow
+
+# 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."""
+    conn = op.get_bind()
+    dialect = conn.dialect.name
+    if dialect == "postgresql":
+        with op.batch_alter_table("task_instance", schema=None) as batch_op:
+            batch_op.alter_column(
+                "trigger_timeout",
+                existing_type=postgresql.TIMESTAMP(),
+                type_=airflow.utils.sqlalchemy.UtcDateTime(timezone=True),
+                existing_nullable=True,
+            )

Review Comment:
   I didn't see the mention until today. Looking...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Update trigger_timeout column in task_instance table to use UtcDateTime [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 commented on PR #44507:
URL: https://github.com/apache/airflow/pull/44507#issuecomment-2517146816

   > Looks good, do we need to handle for mysql too?
   
   In MySql, its stored as `DATETIME` only. I don't think so we need to handle in MySql


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org