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

mypy: error: invalid syntax [syntax] at frictionless/dialect/types.py:28 #1593

Closed
amotl opened this issue Oct 1, 2023 · 2 comments · Fixed by #1594
Closed

mypy: error: invalid syntax [syntax] at frictionless/dialect/types.py:28 #1593

amotl opened this issue Oct 1, 2023 · 2 comments · Fixed by #1594

Comments

@amotl
Copy link
Contributor

amotl commented Oct 1, 2023

Dear @roll,

first things first: Thank you so much for conceiving and maintaining Frictionless. It is true gold.

At daq-tools/skeem#10, we believe we are being tripped by a similar issue already reported at GH-1580 by @aborruso.

At our end, it is the mypy type checker, which fails like:

$ mypy skeem
.venv/lib/python3.10/site-packages/frictionless/dialect/types.py:28: error: invalid syntax  [syntax]
Found 1 error in 1 file (errors prevented further checking)

... when upgrading to frictionless-5.14.x already:

pip install --upgrade "frictionless<5.15"

On the other hand, when downgrading to frictionless-5.13.x:

pip install --upgrade "frictionless<5.14"

... mypy succeeds again:

mypy --install-types --non-interactive skeem
Success: no issues found in 36 source files

With kind regards,
Andreas.

P.S.: We are using the most recent mypy 1.5.1:

$ mypy --version
mypy 1.5.1 (compiled: yes)
@amotl
Copy link
Contributor Author

amotl commented Oct 1, 2023

When upgrading to frictionless-5.15:

pip install --upgrade "frictionless<5.16"

mypy fails like displayed at the CI run of Skeem 1:

$ mypy --install-types --non-interactive skeem
error: --install-types failed (no mypy cache directory)

python/mypy#10768 indicates that this invocation and error report may mask the original error.

Footnotes

  1. https://github.com/daq-tools/skeem/actions/runs/6373504098/job/17297271189?pr=10#step:5:21

@amotl
Copy link
Contributor Author

amotl commented Oct 1, 2023

python/mypy#10768 indicates that this invocation and error report may mask the original error.

Indeed. I only received the error on a fresh checkout, i.e. without an existing .mypy_cache directory. When it is present (mkdir .mypy_cache), the error goes back to:

site-packages/frictionless/resource/types.py:14: error: invalid syntax  [syntax]

... as outlined above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant