Dev-iL commented on code in PR #55954:
URL: https://github.com/apache/airflow/pull/55954#discussion_r2382972608
##########
airflow-core/src/airflow/models/dagwarning.py:
##########
@@ -43,10 +43,10 @@ class DagWarning(Base):
when parsing DAG and displayed on the Webserver in a flash message.
"""
- dag_id = Column(StringID(), primary_key=True)
- warning_type = Column(String(50), primary_key=True)
- message = Column(Text, nullable=False)
- timestamp = Column(UtcDateTime, nullable=False, default=timezone.utcnow)
+ dag_id = mapped_column(StringID(), primary_key=True)
+ warning_type = mapped_column(String(50), primary_key=True)
+ message = mapped_column(Text, nullable=False)
+ timestamp = mapped_column(UtcDateTime, nullable=False,
default=timezone.utcnow)
Review Comment:
`Mapped[...]`
##########
airflow-core/src/airflow/models/dagbundle.py:
##########
@@ -42,12 +42,12 @@ class DagBundleModel(Base, LoggingMixin):
"""
__tablename__ = "dag_bundle"
- name = Column(StringID(length=250), primary_key=True, nullable=False)
- active = Column(Boolean, default=True)
- version = Column(String(200), nullable=True)
- last_refreshed = Column(UtcDateTime, nullable=True)
- signed_url_template = Column(String(200), nullable=True)
- template_params = Column(JSONType, nullable=True)
+ name = mapped_column(StringID(length=250), primary_key=True,
nullable=False)
+ active = mapped_column(Boolean, default=True)
+ version = mapped_column(String(200), nullable=True)
+ last_refreshed = mapped_column(UtcDateTime, nullable=True)
+ signed_url_template = mapped_column(String(200), nullable=True)
+ template_params = mapped_column(JSONType, nullable=True)
Review Comment:
`Mapped[...]`
##########
airflow-core/src/airflow/models/dagbag.py:
##########
@@ -115,14 +116,14 @@ class DagPriorityParsingRequest(Base):
# Adding a unique constraint to fileloc results in the creation of an
index and we have a limitation
# on the size of the string we can use in the index for MySQL DB. We also
have to keep the fileloc
# size consistent with other tables. This is a workaround to enforce the
unique constraint.
- id = Column(String(32), primary_key=True, default=generate_md5_hash,
onupdate=generate_md5_hash)
+ id = mapped_column(String(32), primary_key=True,
default=generate_md5_hash, onupdate=generate_md5_hash)
- bundle_name = Column(StringID(), nullable=False)
+ bundle_name = mapped_column(StringID(), nullable=False)
# The location of the file containing the DAG object
# Note: Do not depend on fileloc pointing to a file; in the case of a
# packaged DAG, it will point to the subpath of the DAG within the
# associated zip.
- relative_fileloc = Column(String(2000), nullable=False)
+ relative_fileloc = mapped_column(String(2000), nullable=False)
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]