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

refactor(python): improve typing; many list types are better defined as Sequence #5164

Merged
merged 1 commit into from
Oct 11, 2022
Merged

refactor(python): improve typing; many list types are better defined as Sequence #5164

merged 1 commit into from
Oct 11, 2022

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Oct 11, 2022

Ran through frame.py and lazyframe.py briefly; a lot (most) of the list[xyz] type decorators are better written as Sequence[xyz] so that they don't cause unnecessary linting errors when passing these params as tuples.


Example: (from join_asof method)

# before
  by_left: str | list[str] | None = None,
  by_right: str | list[str] | None = None,
  by: str | list[str] | None = None,

# after
  by_left: str | Sequence[str] | None = None,
  by_right: str | Sequence[str] | None = None,
  by: str | Sequence[str] | None = None,

@github-actions github-actions bot added python Related to Python Polars refactor Code improvements that do not change functionality labels Oct 11, 2022
@ritchie46 ritchie46 merged commit 6ffed3c into pola-rs:master Oct 11, 2022
@alexander-beedie alexander-beedie deleted the sequence-typing branch October 12, 2022 08:14
zundertj pushed a commit to zundertj/polars that referenced this pull request Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Related to Python Polars refactor Code improvements that do not change functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants