ephraimbuddy commented on code in PR #24156:
URL: https://github.com/apache/airflow/pull/24156#discussion_r909076701
##########
airflow/models/renderedtifields.py:
##########
@@ -46,6 +46,14 @@ class RenderedTaskInstanceFields(Base):
k8s_pod_yaml = Column(sqlalchemy_jsonfield.JSONField(json=json),
nullable=True)
__table_args__ = (
+ PrimaryKeyConstraint(
+ "dag_id",
+ "task_id",
+ "run_id",
+ "map_index",
+ name='rendered_task_instance_fields_pkey',
+ mssql_clustered=True,
+ ),
Review Comment:
From Sqlalchemy:
> The two styles of column-specification should generally not be mixed. An
warning is emitted if the columns present in the
[PrimaryKeyConstraint](https://docs.sqlalchemy.org/en/14/core/constraints.html#sqlalchemy.schema.PrimaryKeyConstraint)
don’t match the columns that were marked as primary_key=True, if both are
present; in this case, the columns are taken strictly from the
[PrimaryKeyConstraint](https://docs.sqlalchemy.org/en/14/core/constraints.html#sqlalchemy.schema.PrimaryKeyConstraint)
declaration, and those columns otherwise marked as primary_key=True are
ignored. This behavior is intended to be backwards compatible with previous
behavior.
Bad practice but we are safe since the fields are matching
--
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]