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

ci: run pyright as part of CI and fix issues it found #22

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

ingomueller-net
Copy link
Collaborator

This PR runs pyright as part of CI and fixes some problems it found:

  • In the DuckDB test, we converted the str Substrait plan to bytes
    even though the parameter expects a str, so the commit removes the
    conversion.
  • In the test for converting MLIR ops to plans, we use some op-specific
    members on an object whose most narrow known type is MlirOperation,
    so the commit adds a cast to make the typing information more
    precise.

I have also tried to set up pytest but couldn't make it find all paths.

@ingomueller-net ingomueller-net force-pushed the ci-pyright branch 11 times, most recently from d1353a8 to 04b8fe2 Compare November 28, 2024 21:54
@ingomueller-net
Copy link
Collaborator Author

(Finally working as intended now and ready for review.)

@CLAassistant
Copy link

CLAassistant commented Nov 29, 2024

CLA assistant check
All committers have signed the CLA.

@@ -49,7 +49,7 @@ def testNamedTable():
pb_plan = ss.to_binpb(plan.operation).encode()

# Execute in duckdb and print result.
query_result = con.from_substrait(proto=pb_plan)
query_result = con.from_substrait(proto=pb_plan) # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ignore?

Signed-off-by: Ingo Müller <[email protected]>
This commit fixes some problems found by `pyright`:
* In the DuckDB test, a `bytes` parameter is wrongly annotated as `str`
  in the stub files of that Python module. We silence that false
  positive with a suppression.
* In the test for converting MLIR ops to plans, we use some op-specific
  members on an object whose most narrow known type is `MlirOperation`,
  so the commit adds a `cast` to make the `typing` information more
  precise.
@ingomueller-net ingomueller-net merged commit 146b50a into substrait-io:main Dec 9, 2024
7 checks passed
@ingomueller-net ingomueller-net deleted the ci-pyright branch December 9, 2024 12:41
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 this pull request may close these issues.

3 participants