You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/05/12 07:03:52 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #31240: Better typing for Job and JobRunners
uranusjr commented on code in PR #31240:
URL: https://github.com/apache/airflow/pull/31240#discussion_r1191986466
##########
airflow/jobs/base_job_runner.py:
##########
@@ -17,22 +17,27 @@
from __future__ import annotations
-from typing import TYPE_CHECKING
+from typing import TYPE_CHECKING, Generic, TypeVar
from airflow.utils.session import NEW_SESSION, provide_session
if TYPE_CHECKING:
from sqlalchemy.orm import Session
from airflow.jobs.job import Job
+ from airflow.serialization.pydantic.job import JobPydantic
+T = TypeVar("T", bound="Job | JobPydantic")
Review Comment:
```suggestion
T = TypeVar("T", Job, JobPydantic)
```
I think this is equivalent and easier to read?
--
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