Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore type checker on click decorators to bypass known library issue #3746

Merged

Conversation

adamsachs
Copy link
Contributor

@adamsachs adamsachs commented Jul 7, 2023

Closes #3745

Description Of Changes

Ignore type checker on problematic function calls with decorator wrappers. This is due to a change in click version 8.1.4 that many others are also hitting: pallets/click#2558

See issue descriptions (ours and theirs) for more detail/context.

Follow up tech debt ticket to revert this eventually, when possible: #3749

Code Changes

  • add comment to ignore type checker on problematic function calls

Steps to Confirm

  • mypy static check passes in CI

Pre-Merge Checklist

@adamsachs adamsachs linked an issue Jul 7, 2023 that may be closed by this pull request
@adamsachs adamsachs self-assigned this Jul 7, 2023
@cypress
Copy link

cypress bot commented Jul 7, 2023

Passing run #3086 ↗︎

0 4 0 0 Flakiness 0

Details:

Merge a620ebb into 962905f...
Project: fides Commit: 42a4ffe927 ℹ️
Status: Passed Duration: 00:47 💡
Started: Jul 7, 2023 9:43 PM Ended: Jul 7, 2023 9:43 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@adamsachs adamsachs force-pushed the 3745-fix-mypy-failures-in-main-caused-by-updated-click-library branch from 90c1768 to 370ac71 Compare July 7, 2023 15:44
@adamsachs adamsachs marked this pull request as ready for review July 7, 2023 15:49
@adamsachs
Copy link
Contributor Author

CI test failures here are a known issue and unrelated, see #3736

@NevilleS
Copy link
Contributor

NevilleS commented Jul 7, 2023

Is there a way to just ignore all typing error from a library in the pyproject.toml?

For example I think this works to ignore a bunch of mypy failures for all our tests: https://github.com/ethyca/fides/blob/main/pyproject.toml#L30

@adamsachs
Copy link
Contributor Author

adamsachs commented Jul 7, 2023

Is there a way to just ignore all typing error from a library in the pyproject.toml?

For example I think this works to ignore a bunch of mypy failures for all our tests: https://github.com/ethyca/fides/blob/main/pyproject.toml#L30

hmm, i think there should be in theory -- i'd expect it to look like this:

[[tool.mypy.overrides]]
module = ["click.*"]
ignore_errors=true

but that's not working when i add it. as a sanity check, when i added this

[[tool.mypy.overrides]]
module = ["fides.cli.options"]
ignore_errors=true

mypy did stop complaining, as expected.

i can keep on digging on it, my guess is that the error's really coming from our module, so it's not effective to ignore errors from the 3rd party lib. we'd have to disable all type checking against that 3rd party lib?

even if i can find a different way to do that, it feels a bit heavy-handed to me, i'd prefer not to ignore all type checking against that library, if possible? although it'd likely be an easier change to revert if/when the underlying problem is fixed 😄

@adamsachs adamsachs force-pushed the 3745-fix-mypy-failures-in-main-caused-by-updated-click-library branch from 370ac71 to a620ebb Compare July 7, 2023 21:26
@galvana galvana self-requested a review July 7, 2023 21:35
Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not be as pretty as we'd like but it works. It avoids side-effects that come with more general error suppression or version pinning. Let's go!

@adamsachs adamsachs merged commit 7d443f6 into main Jul 7, 2023
@adamsachs adamsachs deleted the 3745-fix-mypy-failures-in-main-caused-by-updated-click-library branch July 7, 2023 21:53
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.

Fix mypy failures in main caused by updated click library
3 participants