Skip to content

New ruff fixes - #93

Merged
dylanjmcconnell merged 7 commits into
Open-ISP:mainfrom
bje-:new-ruff-fixes
Sep 15, 2026
Merged

dylanjmcconnell merged 7 commits into
Open-ISP:mainfrom
bje-:new-ruff-fixes

Conversation

@bje-

@bje- bje- commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

First round of Ruff fixes. Note that the changes to src/isp_workbook_parser/read_table.py are due to reindenting an else block. You may find it easier to review by ignoring whitespace changes in this file.

@dylanjmcconnell

Copy link
Copy Markdown
Member

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..

@bje-

bje- commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author
 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
3

This is a simplication recommended by Ruff rule SIM118.

@dylanjmcconnell

Copy link
Copy Markdown
Member

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)

@bje-

bje- commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

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.

@bje-

bje- commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll file a bug report against Ruff. It should know that this isn't a dict.

Already known:
astral-sh/ruff#27224

Comment thread src/isp_workbook_parser/parser.py Outdated
Co-authored-by: Dylan McConnell <18433446+dylanjmcconnell@users.noreply.github.com>
@dylanjmcconnell

Copy link
Copy Markdown
Member

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 unfixable = ["SIM118"] - so flagged but not fixed)

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/isp_workbook_parser/parser.py 63.88% 13 Missing ⚠️
src/isp_workbook_parser/read_table.py 81.08% 4 Missing and 3 partials ⚠️
Files with missing lines Coverage Δ
src/isp_workbook_parser/config_model.py 100.00% <100.00%> (ø)
src/isp_workbook_parser/sanitisers.py 100.00% <100.00%> (ø)
src/isp_workbook_parser/read_table.py 90.00% <81.08%> (-6.71%) ⬇️
src/isp_workbook_parser/parser.py 86.92% <63.88%> (-2.23%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dylanjmcconnell
dylanjmcconnell merged commit 29a1fb0 into Open-ISP:main Sep 15, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants