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/07 20:37:56 UTC

[airflow] branch main updated: Support Pydantic 2 (#32366)

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

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9cb463e20e Support Pydantic 2 (#32366)
9cb463e20e is described below

commit 9cb463e20e4557efb4d1a6320b196c65ae519c23
Author: Tzu-ping Chung <ur...@gmail.com>
AuthorDate: Sat Jul 8 04:37:49 2023 +0800

    Support Pydantic 2 (#32366)
    
    * Remove Pydantic limit
    * Use base datetime class for Pydantic
---
 airflow/serialization/pydantic/dag_run.py | 3 +--
 setup.cfg                                 | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/airflow/serialization/pydantic/dag_run.py b/airflow/serialization/pydantic/dag_run.py
index a5ae6b4a22..1e1528eb35 100644
--- a/airflow/serialization/pydantic/dag_run.py
+++ b/airflow/serialization/pydantic/dag_run.py
@@ -18,7 +18,6 @@
 from datetime import datetime
 from typing import List, Optional
 
-from pendulum import DateTime
 from pydantic import BaseModel as BaseModelPydantic
 
 from airflow.serialization.pydantic.dataset import DatasetEventPydantic
@@ -30,7 +29,7 @@ class DagRunPydantic(BaseModelPydantic):
     id: int
     dag_id: str
     queued_at: Optional[datetime]
-    execution_date: DateTime
+    execution_date: datetime
     start_date: Optional[datetime]
     end_date: Optional[datetime]
     state: str
diff --git a/setup.cfg b/setup.cfg
index 91d3b86331..d5d91d3d8f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -126,9 +126,7 @@ install_requires =
     pendulum>=2.0
     pluggy>=1.0
     psutil>=4.2.0
-    # Limit Pydantic to <2.0.0 because it breaks Kubernetes tests and building providers
-    # This limit should be removed after https://github.com/apache/airflow/issues/32311 is fixed
-    pydantic>=1.10.0,<2.0.0
+    pydantic>=1.10.0
     pygments>=2.0.1
     pyjwt>=2.0.0
     python-daemon>=3.0.0