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

refactor: DRY code added for ip address #211

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

brunolnetto
Copy link

@brunolnetto brunolnetto commented Aug 15, 2024

Tests passing, removed repeated code.

@thentgesMindee
Copy link
Collaborator

Hi, thanks for the PR, LGTM but the CI is failing: you need to run black on your changes + there seems to be a Semantic PR check as well which I'm not completely aware of

@brunolnetto
Copy link
Author

brunolnetto commented Aug 16, 2024

Buttocks. Semantic PR — ready to be squashed.

@laurentS laurentS changed the title refac: DRY code added for ip address refactor: DRY code added for ip address Aug 16, 2024
@brunolnetto
Copy link
Author

Command run mypy is failing like below. Weird. :-(

slowapi/util.py:10: error: Item "None" of "Optional[Address]" has no attribute "host"

@laurentS
Copy link
Owner

Command run mypy is failing like below. Weird. :-(

slowapi/util.py:10: error: Item "None" of "Optional[Address]" has no attribute "host"

mypy is telling you that request.client is of type Optional[Address] so it can be None, in which case there is no attribute host on it (the last part of your line).
It looks like it's not smart enough to figure out the logic you wrote. You have 2 options (at least):

  • change your code to a plain if ...
  • silence mypy with a # type: ignore comment at the end of the line.

@brunolnetto
Copy link
Author

@laurentS I fixed as suggested.

@laurentS
Copy link
Owner

@laurentS I fixed as suggested.

@brunolnetto Can you run the various checks locally before pushing? It will avoir the back and forth.

@brunolnetto
Copy link
Author

I run command poetry run mypy ., but this error is annoying me somewhat. Do you still have any idea what I am facing?

error: Positional-only parameters are only supported in Python 3.8 and greater

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.

3 participants