Dev-iL commented on code in PR #55954:
URL: https://github.com/apache/airflow/pull/55954#discussion_r2382973426


##########
airflow-core/src/airflow/models/errors.py:
##########
@@ -17,22 +17,22 @@
 # under the License.
 from __future__ import annotations
 
-from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy import Integer, String, Text
 
 from airflow.dag_processing.bundles.manager import DagBundlesManager
 from airflow.models.base import Base, StringID
-from airflow.utils.sqlalchemy import UtcDateTime
+from airflow.utils.sqlalchemy import UtcDateTime, mapped_column
 
 
 class ParseImportError(Base):
     """Stores all Import Errors which are recorded when parsing DAGs and 
displayed on the Webserver."""
 
     __tablename__ = "import_error"
-    id = Column(Integer, primary_key=True)
-    timestamp = Column(UtcDateTime)
-    filename = Column(String(1024))
-    bundle_name = Column(StringID())
-    stacktrace = Column(Text)
+    id = mapped_column(Integer, primary_key=True)
+    timestamp = mapped_column(UtcDateTime)
+    filename = mapped_column(String(1024))
+    bundle_name = mapped_column(StringID())
+    stacktrace = mapped_column(Text)

Review Comment:
   `Mapped[...]`



##########
airflow-core/src/airflow/models/hitl.py:
##########
@@ -84,31 +84,31 @@ class HITLDetail(Base):
     """Human-in-the-loop request and corresponding response."""
 
     __tablename__ = "hitl_detail"
-    ti_id = Column(
+    ti_id = mapped_column(
         String(36).with_variant(postgresql.UUID(as_uuid=False), "postgresql"),
         primary_key=True,
         nullable=False,
     )
 
     # User Request Detail
-    options = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=False)
-    subject = Column(Text, nullable=False)
-    body = Column(Text, nullable=True)
-    defaults = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=True)
-    multiple = Column(Boolean, unique=False, default=False)
-    params = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=False, 
default={})
-    assignees = Column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)
-    created_at = Column(UtcDateTime, default=timezone.utcnow, nullable=False)
+    options = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=False)
+    subject = mapped_column(Text, nullable=False)
+    body = mapped_column(Text, nullable=True)
+    defaults = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)
+    multiple = mapped_column(Boolean, unique=False, default=False)
+    params = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=False, default={})
+    assignees = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)
+    created_at = mapped_column(UtcDateTime, default=timezone.utcnow, 
nullable=False)
 
     # Response Content Detail
-    responded_at = Column(UtcDateTime, nullable=True)
-    responded_by = Column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)
-    chosen_options = Column(
+    responded_at = mapped_column(UtcDateTime, nullable=True)
+    responded_by = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=True)
+    chosen_options = mapped_column(
         sqlalchemy_jsonfield.JSONField(json=json),
         nullable=True,
         default=None,
     )
-    params_input = Column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=False, default={})
+    params_input = mapped_column(sqlalchemy_jsonfield.JSONField(json=json), 
nullable=False, default={})

Review Comment:
   `Mapped[...]`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to