Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin universal-pathlib to 0.2.2 as 0.2.3 generates static code check errors #41715

Conversation

jscheffl
Copy link
Contributor

This PR fixes the Mypy Errors I see on my PR since universal-pathlib 0.2.3 has been released:

Manual MyPy Airflow:

 airflow/io/path.py:201: error: Unexpected keyword argument "overwrite" for
"rename" of "UPath"  [call-arg]
            return self.rename(target, overwrite=True)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Manual MyPy Providers:

airflow/providers/common/io/xcom/backend.py:145: error: Argument 1 to
"joinpath" of "UPath" has incompatible type "Optional[str]"; expected
"Union[str, PathLike[str]]"  [arg-type]
                p = base_path.joinpath(dag_id, run_id, task_id, f"{uuid.uu...
                                       ^~~~~~
airflow/providers/common/io/xcom/backend.py:145: error: Argument 2 to
"joinpath" of "UPath" has incompatible type "Optional[str]"; expected
"Union[str, PathLike[str]]"  [arg-type]
                p = base_path.joinpath(dag_id, run_id, task_id, f"{uuid.uu...
                                               ^~~~~~
airflow/providers/common/io/xcom/backend.py:145: error: Argument 3 to
"joinpath" of "UPath" has incompatible type "Optional[str]"; expected
"Union[str, PathLike[str]]"  [arg-type]
    ...          p = base_path.joinpath(dag_id, run_id, task_id, f"{uuid.uuid...
                                                        ^~~~~~~

Where the interface for XCom only allows a pre-raising if params are missing, the error in core with overwrite is something where logic might need to be adjusted for a permanent fix. But as this turns all PRs red, proposing to just pin version to 0.2.2 for the moment.

@bolkedebruin Do you have a better idea?

@jscheffl jscheffl merged commit 1c53961 into apache:main Aug 24, 2024
109 checks passed
@potiuk
Copy link
Member

potiuk commented Aug 25, 2024

What we usually do in those cases - we create an issue and link URL to that issue in the comment #41723

@potiuk potiuk added this to the Airflow 2.10.1 milestone Aug 28, 2024
potiuk pushed a commit to potiuk/airflow that referenced this pull request Aug 28, 2024
potiuk added a commit that referenced this pull request Aug 28, 2024
…rrors (#41715) (#41820)

(cherry picked from commit 1c53961)

Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
@utkarsharma2 utkarsharma2 added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Aug 30, 2024
utkarsharma2 pushed a commit that referenced this pull request Sep 2, 2024
…rrors (#41715) (#41820)

(cherry picked from commit 1c53961)

Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants