Skip to content

Commit

Permalink
account for new ruff lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Feb 16, 2023
1 parent cc64734 commit 0378614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions py-polars/polars/internals/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,11 +1234,14 @@ def pandas_has_default_index(df: pd.DataFrame) -> bool:
index_cols = df.index.names

if len(index_cols) > 1:
return False # not default: more than one index
# not default: more than one index
return False
elif index_cols not in ([None], [""]):
return False # not default: index is named
# not default: index is named
return False
elif df.index.equals(RangeIndex(start=0, stop=len(df), step=1)):
return True # is default: simple range index
# is default: simple range index
return True
else:
# finally, is the index _equivalent_ to a default unnamed
# integer index with frame data that was previously sorted
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/internals/series/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4805,7 +4805,7 @@ def map_dict(
... "NLD": "Netherlands",
... }
Remap, setting a default value for unrecognised values...
Remap, setting a default for unrecognised values...
>>> s.map_dict(country_lookup, default="Unspecified").rename("country_name")
shape: (4,)
Expand Down

0 comments on commit 0378614

Please sign in to comment.