You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/09 09:24:12 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #24044: Have consistent types between the ORM and the migration files

uranusjr commented on code in PR #24044:
URL: https://github.com/apache/airflow/pull/24044#discussion_r893275723


##########
airflow/models/variable.py:
##########
@@ -47,7 +48,7 @@ class Variable(Base, LoggingMixin):
 
     id = Column(Integer, primary_key=True)
     key = Column(String(ID_LEN), unique=True)
-    _val = Column('val', Text)
+    _val = Column('val', Text().with_variant(MEDIUMTEXT, 'mysql'))

Review Comment:
   Why do some of the Text fields need a MySQL variant, but some don’t? Should we unify them?



##########
airflow/models/trigger.py:
##########
@@ -52,7 +52,7 @@ class Trigger(Base):
     id = Column(Integer, primary_key=True)
     classpath = Column(String(1000), nullable=False)
     kwargs = Column(ExtendedJSON, nullable=False)
-    created_date = Column(UtcDateTime, nullable=False)
+    created_date = Column(DateTime, nullable=False)  # DateTime without timezone

Review Comment:
   I feel this _should_ use UtcDateTime.



##########
airflow/models/serialized_dag.py:
##########
@@ -67,7 +67,7 @@ class SerializedDagModel(Base):
     dag_id = Column(String(ID_LEN), primary_key=True)
     fileloc = Column(String(2000), nullable=False)
     # The max length of fileloc exceeds the limit of indexing.
-    fileloc_hash = Column(BigInteger, nullable=False)
+    fileloc_hash = Column(BigInteger().with_variant(Integer, 'sqlite'), nullable=False)

Review Comment:
   Similarly, it seems suspicious this needs a variant, but `pickle_hash` on DagPickle does not.



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