Skip to content

Commit

Permalink
fix(python): bound complex type from 3.8 to 3.11 (#6071)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jan 5, 2023
1 parent 40424c4 commit a17436d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions py-polars/polars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from typing_extensions import ParamSpec, TypeGuard

# note: reversed views don't match as instances of MappingView
if sys.version_info >= (3, 8):
if sys.version_info >= (3, 11):
_reverse_mapping_views = tuple(
type(reversed(cast(Reversible[Any], view)))
for view in ({}.keys(), {}.values(), {}.items())
Expand Down Expand Up @@ -117,7 +117,7 @@ def _is_generator(val: object) -> bool:
return (
(isinstance(val, (Generator, Iterable)) and not isinstance(val, Sized))
or isinstance(val, MappingView)
or (sys.version_info >= (3, 8) and isinstance(val, _reverse_mapping_views))
or (sys.version_info >= (3, 11) and isinstance(val, _reverse_mapping_views))
)


Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/test_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ def __iter__(self) -> Iterator[Any]:
"vals": ["x", "y", "z"],
"itms": [(0, "x"), (1, "y"), (2, "z")],
}
if sys.version_info >= (3, 8):
if sys.version_info >= (3, 11):
df = pl.DataFrame(
{
"rev_keys": reversed(d.keys()),
Expand Down

0 comments on commit a17436d

Please sign in to comment.