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

chore(python): Fix type stubs for updated module structure #606

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

paleolimbot
Copy link
Member

@paleolimbot paleolimbot commented Sep 6, 2024

This PR updates the type stubs for the Cython modules to reflect the updated structure. I don't think this mechanism for generating stubs is the best long-term strategy (requires remembering to do so!)...we could also do something like omit the generated stubs from the source tree and generate them only before packaging; however, this would make them not useful for local development (which is one of the primary short-term benefits of including them).

@paleolimbot paleolimbot marked this pull request as ready for review September 9, 2024 15:13
@paleolimbot
Copy link
Member Author

@jorisvandenbossche I know you've looked at this from the pyarrow perspective...any thoughts about this as an acceptable step towards the perfect type stub workflow?

@jorisvandenbossche
Copy link
Member

Unfortunately a perfect one doesn't exist for now, I think ;)

The stubtest didn't catch that the stub files were out of sync with the updated code? (I don't expect stubtest to verify if the stubs are correct, but at least that it matches the set of objects that are present in the imported module)

@paleolimbot
Copy link
Member Author

The stubtest didn't catch that the stub files were out of sync with the updated code?

It didn't, and I just made an attempt to intentionally introduce an error in the stubs and found that it wasn't reported either 😬 . I think it has something to do with the fact that all of the files begin with an underscore and maybe aren't type-checked in the same way. VSCode still seems to be able to find the types when dealing with things like array.buffer(0).XXX

@paleolimbot
Copy link
Member Author

I'm going to merge this so that we can have stubs in our release; however, we'll need to follow up to make sure these stay up-to-date! #624

@paleolimbot paleolimbot merged commit 499d865 into apache:main Sep 19, 2024
11 checks passed
@paleolimbot paleolimbot deleted the nanoarrow-update-stubs branch September 19, 2024 03:36
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.

2 participants