Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With Pylint 3.2 the E0606 error is being raised in a few places, i.e.:
As it was found in #1282 (comment).
The current solution has been to block Pylint updates, but this is not great.
I tried to fix the error in a few places, by various mechanisms, but there is a common source for this: the
raise_error
function.Unfortunately, Pylint is not being able to detect that the
raise_error
function is just raising an error, and so the respective branches in the variousif
s will never return.I tried to tell it through the
typing.NoReturn
hint (better calledNever
, but only from py3.11 on...), but it didn't work.The simple option is to keep applying fixes like the one showcased here for the few missing cases, and just upgrade Pylint.
The other two, more drastic, options are:
raise_error
, and just stick to the built-inraise
ruff
Both of them are feasible, but both of them would require non-negligible effort (the first is spread throughout the whole codebase, and dependent packages - though we are already considering removing in other places because of #1117 - and the second requires workflows upgrades, and possibly further lints to fix).