jason810496 commented on code in PR #55952:
URL: https://github.com/apache/airflow/pull/55952#discussion_r2392053643


##########
airflow-core/src/airflow/models/hitl_history.py:
##########
@@ -0,0 +1,90 @@
+# 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.
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+import sqlalchemy_jsonfield
+from sqlalchemy import Boolean, Column, ForeignKeyConstraint, String, Text
+from sqlalchemy.dialects import postgresql
+from sqlalchemy.orm import relationship
+
+from airflow._shared.timezones import timezone
+from airflow.models.base import Base
+from airflow.settings import json
+from airflow.utils.sqlalchemy import UtcDateTime
+
+if TYPE_CHECKING:
+    from airflow.models.hitl import HITLDetail
+
+
+class HITLDetailHistory(Base):

Review Comment:
   It seems the `HITLDetailPropertyMixin` is missing here?



##########
airflow-core/src/airflow/models/hitl_history.py:
##########
@@ -0,0 +1,90 @@
+# 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.
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+import sqlalchemy_jsonfield
+from sqlalchemy import Boolean, Column, ForeignKeyConstraint, String, Text
+from sqlalchemy.dialects import postgresql
+from sqlalchemy.orm import relationship
+
+from airflow._shared.timezones import timezone
+from airflow.models.base import Base
+from airflow.settings import json
+from airflow.utils.sqlalchemy import UtcDateTime
+
+if TYPE_CHECKING:
+    from airflow.models.hitl import HITLDetail
+
+
+class HITLDetailHistory(Base):
+    """
+    Store HITLDetail for old tries of TaskInstances.
+
+    :meta private:
+    """
+
+    __tablename__ = "hitl_detail_history"
+    ti_history_id = 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)

Review Comment:
   Sorry that I should describe more throughly earlier.  
   
   I means that if it is possible to move to common columns for both 
`HITLDetail` and `HITLDetailHistory` to `HITLDetailPropertyMixin` ( maybe 
`BaseHITLDetail` naming will be more suitable name if this is the case ). This 
helps prevent oversights when modifying columns in either one.



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