Skip to content

feat(python): add files lance/schema.py, lance/file.py, lance/util.py for pyright typecheck#3454

Merged
wjones127 merged 1 commit into
lance-format:mainfrom
renato2099:renato2099/3294
Feb 18, 2025
Merged

feat(python): add files lance/schema.py, lance/file.py, lance/util.py for pyright typecheck#3454
wjones127 merged 1 commit into
lance-format:mainfrom
renato2099:renato2099/3294

Conversation

@renato2099

@renato2099 renato2099 commented Feb 16, 2025

Copy link
Copy Markdown
Contributor

This just adds the lance/schema.py, lance/file.py, lance/util.py files such that they can be checked with pyright. Fixes #329

@github-actions github-actions Bot added the A-python Python bindings label Feb 16, 2025
@github-actions

Copy link
Copy Markdown
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@renato2099 renato2099 changed the title 3294: Add python files for pyright typecheck feat(python): Add python files for pyright typecheck Feb 16, 2025
@github-actions github-actions Bot added the enhancement New feature or request label Feb 16, 2025
@renato2099 renato2099 changed the title feat(python): Add python files for pyright typecheck feat(python): Add python files (lance/schema.py, lance/file.py, lance/util.py) for pyright typecheck Feb 16, 2025
@renato2099
renato2099 force-pushed the renato2099/3294 branch 2 times, most recently from 13b4ab5 to fca8b0f Compare February 16, 2025 22:31
@renato2099

renato2099 commented Feb 16, 2025

Copy link
Copy Markdown
Contributor Author

Running make lint-python I get

ruff format --check python
112 files already formatted
ruff check python
All checks passed!
pyright
/Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/util.py
  /Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/util.py:9:8 - warning: Stub file not found for "pyarrow" (reportMissingTypeStubs)
/Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/dependencies.py
  /Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/dependencies.py:164:12 - warning: Stub file not found for "datasets" (reportMissingTypeStubs)
  /Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/dependencies.py:166:12 - warning: Stub file not found for "pandas" (reportMissingTypeStubs)
  /Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/dependencies.py:169:12 - warning: Stub file not found for "tensorflow" (reportMissingTypeStubs)
/Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/schema.py
  /Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/schema.py:7:8 - warning: Stub file not found for "pyarrow" (reportMissingTypeStubs)
/Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/file.py
  /Users/rmarroqu/Documents/workspace/lancedb_playground/lance/python/python/lance/file.py:7:8 - warning: Stub file not found for "pyarrow" (reportMissingTypeStubs)
0 errors, 6 warnings, 0 informations

So I guess it is all good?

@renato2099 renato2099 changed the title feat(python): Add python files (lance/schema.py, lance/file.py, lance/util.py) for pyright typecheck feat(python): Add files lance/schema.py, lance/file.py, lance/util.py for pyright typecheck Feb 16, 2025
@westonpace westonpace changed the title feat(python): Add files lance/schema.py, lance/file.py, lance/util.py for pyright typecheck feat(python): add files lance/schema.py, lance/file.py, lance/util.py for pyright typecheck Feb 17, 2025

@westonpace westonpace left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll let @wjones127 take a look too but this looks good to me. Thanks!

@wjones127

Copy link
Copy Markdown
Contributor

This seems okay. There are various typing issues I can see manually. (For example, LanceFileReader.__init__() says it only takes a str path but implementation supports Path.) Also there's probably some things we would catch if we also checked the corresponding test files. If you are interesting in doing that, I'll let you do that in a follow up.

@wjones127
wjones127 merged commit 9ea6b7e into lance-format:main Feb 18, 2025
@renato2099

Copy link
Copy Markdown
Contributor Author

Also there's probably some things we would catch if we also checked the corresponding test files. If you are interesting in doing that, I'll let you do that in a follow up.

sounds good 👍 but are you thinking on manually checking the test files or adding the files to be checked by pyright as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typecheck lance/schema.py, lance/file.py, lance/util.py

3 participants