New ruff fixes - #93
Conversation
|
Hey @bje- think I found a different linting change issue (in addition to the versions str/path issue).. namely a change in one of the sanitiser functions. for object_col in df.dtypes[df.dtypes == "object"].keys():
#changed to:
for object_col in df.dtypes[df.dtypes == "object"]:i.e. keys method dropped (..seems weird for a linting change?) - so iterates through values.. |
No, it iterates through keys. eg: >>> d = {1: 100, 2: 200, 3: 300}
>>> for k in d:
... print(k)
...
1
2
3This is a simplication recommended by Ruff rule SIM118. |
|
That works for a dict. It is not a dict - It is a pandas series. I meant that it iterates through values in a pandas series (not values in a dict) |
Oooh, nasty. :-) Arguably a poor design choice by Pandas. |
|
I'll file a bug report against Ruff. It should know that this isn't a dict. Already known: |
Co-authored-by: Dylan McConnell <18433446+dylanjmcconnell@users.noreply.github.com>
|
Hey I just realised that precommit / pyproject.toml still only selects the (much more limited) ["I"] Could I suggest, as part of the PR, you include the rule categories you have added to the pyproject.toml? (and probably have |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
First round of Ruff fixes. Note that the changes to
src/isp_workbook_parser/read_table.pyare due to reindenting anelseblock. You may find it easier to review by ignoring whitespace changes in this file.