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 deaa069
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions py-polars/polars/internals/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,12 +1233,12 @@ 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
elif index_cols not in ([None], [""]):
return False # not default: index is named
if len(index_cols) > 1 or index_cols not in ([None], [""]):
# not default: more than one index, or 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 deaa069

Please sign in to comment.