potiuk commented on code in PR #35970:
URL: https://github.com/apache/airflow/pull/35970#discussion_r1411830974
##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -1815,3 +1871,26 @@ def update_constraints(
if confirm_modifications(constraints_repo):
commit_constraints_and_tag(constraints_repo, airflow_version,
commit_message)
push_constraints_and_tag(constraints_repo, remote_name,
airflow_version)
+
+
+class VersionedFile(NamedTuple):
+ from packaging.version import Version
Review Comment:
This is not going to work because Version is used as Type Hint.
What you need to do in this case, you need to import Version at top level
with TYPE_CHECKING.
```
if TYPE_CHECKING:
from packaging.version import Version
```
Then it will only be considered during MyPy and similar checks.
We are using similar approach in a number of other places to avoid this
problem - look for TYPE_CHECKING
##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -1815,3 +1871,26 @@ def update_constraints(
if confirm_modifications(constraints_repo):
commit_constraints_and_tag(constraints_repo, airflow_version,
commit_message)
push_constraints_and_tag(constraints_repo, remote_name,
airflow_version)
+
+
+class VersionedFile(NamedTuple):
+ from packaging.version import Version
Review Comment:
This is not going to work because Version is used as Type Hint.
What you need to do in this case, you need to import Version at top level
with TYPE_CHECKING.
```python
if TYPE_CHECKING:
from packaging.version import Version
```
Then it will only be considered during MyPy and similar checks.
We are using similar approach in a number of other places to avoid this
problem - look for TYPE_CHECKING
--
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]