You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/07/02 07:32:47 UTC

[airflow] 18/19: Fix Pydantic 2 pickiness about model definition (#32307)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-6-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4e1c0bb6380572569991b278313af17195b4e3e5
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sat Jul 1 23:41:59 2023 +0200

    Fix Pydantic 2 pickiness about model definition (#32307)
    
    The new Pydantic 2 has been released on 30th of June and it is a
    bit more picky about model definition, thus causing Airflow to
    fail because there were wrong definitions of models (previously
    corretly validated).
    
    Fixes: #32301
    (cherry picked from commit 4d84e304b86c97d0437fddbc6b6757b5201eefcc)
---
 airflow/serialization/pydantic/dataset.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/airflow/serialization/pydantic/dataset.py b/airflow/serialization/pydantic/dataset.py
index 39c552eea9..2aa021438b 100644
--- a/airflow/serialization/pydantic/dataset.py
+++ b/airflow/serialization/pydantic/dataset.py
@@ -44,10 +44,10 @@ class TaskOutletDatasetReferencePydantic(BaseModelPydantic):
     """
 
     dataset_id: int
-    dag_id = str
-    task_id = str
-    created_at = datetime
-    updated_at = datetime
+    dag_id: str
+    task_id: str
+    created_at: datetime
+    updated_at: datetime
 
     class Config:
         """Make sure it deals automatically with ORM classes of SQL Alchemy"""