-
-
Notifications
You must be signed in to change notification settings - Fork 927
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
add type annotations to kombu/transport/azurestoragequeues #1632
Conversation
9cbb53e
to
73bca59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one thing I need you to change and then we can merge this PR
no_ack = True | ||
_noack_queues = set() | ||
domain_format: str = 'kombu%(vhost)s' | ||
_queue_service: QueueServiceClient | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't _queue_service be Optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thedrow I agree, but the pre-commit.ci automatically corrected it and switched it from Optional[QueueServiceClient]
to this. I just assumed this was an alternative way to declare the same thing, but outside of this project I would always use the Optional[QueueServiceClient]
notation.
The docs you linked also mention this is an alternative syntax and that the two are equivalent.
Optional[X]
is equivalent toX | None
(orUnion[X, None]
).
What should I do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the updates, and I assume pre-commit.ci will add a commit correcting it, but we'll see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, pre-commit.ci corrected it so I just re-pushed the original content that you commented on. Should I try to update the pre-commit.ci configuration or merge as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can update the pre-commit config that would be great but I wouldn't block merging this PR without that config change.
default_port = None | ||
can_parse_url = True | ||
polling_interval: int = 1 | ||
default_port: int | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type here is Optional too
864c0bf
to
73bca59
Compare
@thedrow I reviewed the inline comments and responded with why I didn't do that. Please let me know how you would like me to proceed. |
73bca59
to
38fb6af
Compare
@thedrow I ended up finding the root cause of this. It turns out PEP 604 docs: https://peps.python.org/pep-0604/ If you'd like to keep pyupgrade from updating this, we could use the following argument; Standing by waiting for your input. |
38fb6af
to
1ebb470
Compare
I just rebased this PR off of main. |
Yeah let's configure pyupdate to keep |
Per celery#1632 @thedrow asked to add this argument so `Optional` is still used.
1ebb470
to
976e7eb
Compare
8aa637d
to
f2c700a
Compare
f82a494
to
9a04ec0
Compare
LGTM but I'll let @thedrow have the final word here |
This isn't complete, but at least it's a start. I'm open to any feedback.