You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "nhuantho (via GitHub)" <gi...@apache.org> on 2025/12/29 18:59:37 UTC
[PR] Using unified BaseModel for rest api [airflow]
nhuantho opened a new pull request, #59894:
URL: https://github.com/apache/airflow/pull/59894
## Why:
* [44267](https://github.com/apache/airflow/pull/44267) created BaseModel for rest api. I thought that we could refactor BaseModel of pydantic to BaseModel in airflow-core/src/airflow/api_fastapi/core_api/base.py.
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
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
Re: [PR] Using unified BaseModel for rest api [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #59894:
URL: https://github.com/apache/airflow/pull/59894#discussion_r2652816232
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py:
##########
@@ -19,8 +19,7 @@
from datetime import datetime
from typing import Literal
-from pydantic import BaseModel
Review Comment:
Yep. another PR is fine.
--
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
Re: [PR] Using unified BaseModel for rest api [airflow]
Posted by "nhuantho (via GitHub)" <gi...@apache.org>.
nhuantho commented on code in PR #59894:
URL: https://github.com/apache/airflow/pull/59894#discussion_r2652319193
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py:
##########
@@ -19,8 +19,7 @@
from datetime import datetime
from typing import Literal
-from pydantic import BaseModel
Review Comment:
@potiuk, Does it need to be added in this pr or another pr?
--
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
Re: [PR] Using unified BaseModel for rest api [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #59894:
URL: https://github.com/apache/airflow/pull/59894
--
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
Re: [PR] Using unified BaseModel for rest api [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #59894:
URL: https://github.com/apache/airflow/pull/59894#discussion_r2651872344
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py:
##########
@@ -19,8 +19,7 @@
from datetime import datetime
from typing import Literal
-from pydantic import BaseModel
Review Comment:
Should we also add a `prek` hook to forbid using pydantic BaseModel directly ? Otherwise any such change is just *for now* and it does not prevent future, similar problems
--
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
Re: [PR] Using unified BaseModel for rest api [airflow]
Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #59894:
URL: https://github.com/apache/airflow/pull/59894#discussion_r2652337261
##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py:
##########
@@ -19,8 +19,7 @@
from datetime import datetime
from typing import Literal
-from pydantic import BaseModel
Review Comment:
Yep, good idea to add a prek hook. @nhuantho it can be a follow up.
--
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