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

fix(python): Fix read_database(…,iter_batches=True) type annotations #19832

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

iliya-malecki
Copy link
Contributor

@iliya-malecki iliya-malecki commented Nov 17, 2024

Closes #19800.

Fixed the typing and while i was at it i fixed the typing a little deeper, including returning Iterator from inner functions and importing Selectable correctly in an if TYPE_CHECKING block.

in a if TYPE_CHECKING block no runtime behavior can exist, such as try-excepts. They were replaced by a single import
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.33%. Comparing base (da38e37) to head (04da097).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19832   +/-   ##
=======================================
  Coverage   79.33%   79.33%           
=======================================
  Files        1548     1548           
  Lines      214247   214247           
  Branches     2460     2460           
=======================================
+ Hits       169971   169974    +3     
+ Misses      43718    43715    -3     
  Partials      558      558           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexander-beedie alexander-beedie added the A-typing Area: type checking label Nov 17, 2024
Copy link
Collaborator

@alexander-beedie alexander-beedie left a comment

Choose a reason for hiding this comment

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

Good stuff, thanks 👍

@alexander-beedie alexander-beedie changed the title fix(python): Fix read_database(..., iter_batches=True) return type from Iterable to Iterator fix(python): Fix read_database(..., iter_batches=True) type annotations Nov 17, 2024
@alexander-beedie alexander-beedie changed the title fix(python): Fix read_database(..., iter_batches=True) type annotations fix(python): Fix read_database(…, iter_batches=True) type annotations Nov 17, 2024
@alexander-beedie alexander-beedie changed the title fix(python): Fix read_database(…, iter_batches=True) type annotations fix(python): Fix read_database(…,iter_batches=True) type annotations Nov 17, 2024
@alexander-beedie alexander-beedie merged commit 8c0c7c5 into pola-rs:main Nov 17, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typing Area: type checking fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect typing of polars.read_database when iter_batches=True
2 participants