Skip to content

fix mypy check failure on main - #42976

Merged
potiuk merged 4 commits into
apache:mainfrom
rawwar:kalyan/refactor/fix_mypy_conftest
Oct 14, 2024
Merged

fix mypy check failure on main#42976
potiuk merged 4 commits into
apache:mainfrom
rawwar:kalyan/refactor/fix_mypy_conftest

Conversation

@rawwar

Copy link
Copy Markdown
Contributor

pre-commit run --all-files on main results in following error for "Run mypy for airflow"

task_sdk/tests/conftest.py:26: error: Incompatible types in assignment
(expression has type "tuple[()]", target has type "Union[str, list[str]]") [assignment]
config.inicfg["airflow_deprecations_ignore"] = ()
^~

I noticed, in other places, assignment for config.inicfg has the ignore comment -

config.inicfg["airflow_deprecations_ignore"] = (

Comment threadtask_sdk/tests/conftest.py Outdated
Comment threadtask_sdk/tests/conftest.py Outdated
@potiuk

Copy link
Copy Markdown
Member

Actually the error you get is CAUSED by using "". It should be []

The error is caused by this line:

 if isinstance(deprecations_ignore, (str, os.PathLike)):
self.deprecations_ignore = [deprecations_ignore]

Which turns the "" into a single-element array with empty string.

Comment threadtask_sdk/tests/conftest.py Outdated
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@potiuk
potiuk merged commit baa87b6 into apache:mainOct 14, 2024
@potiuk

Copy link
Copy Markdown
Member

Solved :)

@rawwar
rawwar deleted the kalyan/refactor/fix_mypy_conftest branch October 14, 2024 09:24
@kaxil

Copy link
Copy Markdown
Member

Nice

R7L208 pushed a commit to R7L208/airflow that referenced this pull request Oct 17, 2024
* fix mypy error
* Apply suggestions from code review
* Update conftest.py
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
---------
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
harjeevanmaan pushed a commit to harjeevanmaan/airflow that referenced this pull request Oct 23, 2024
* fix mypy error
* Apply suggestions from code review
* Update conftest.py
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
---------
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
PaulKobow7536 pushed a commit to PaulKobow7536/airflow that referenced this pull request Oct 24, 2024
* fix mypy error
* Apply suggestions from code review
* Update conftest.py
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
---------
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
* fix mypy error
* Apply suggestions from code review
* Update conftest.py
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
---------
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rawwar@potiuk@kaxil