-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Implement Azure service bus subscription (create, delete)Operators #24625
Implement Azure service bus subscription (create, delete)Operators #24625
Conversation
Created PR for Azure service bus subscription(create, delete) operator |
aadd8f7
to
7e7a016
Compare
@@ -114,6 +119,93 @@ def delete_queue(self, queue_name: str) -> None: | |||
with self.get_conn() as service_mgmt_conn: | |||
service_mgmt_conn.delete_queue(queue_name) | |||
|
|||
def create_subscription( |
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 suggest to just use the underlying client method rather than adding this one
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.
@dstandish You are suggesting to call the create_subscription client method in operator ? if yes how will I get the connection ? should I call the get_conn()
method in operator ?
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.
yes that was the suggestion. but i don't have strong feelings if you want to go this way and you've already got an approval so it's up to you.
i am just of the philosophy that when the client methods already do exactly what we need, we don't need to implement those exact methods. mainly it's for autocomplete i guess? to me it seems simpler to just use the methods and let the hook be lighter weight and reduce our maintenance burden. on the other hand, i understand there's an argument that implementing methods like this aids in discoverability of features for users, and is worth it despite adding code that doesn "need" to be there.
related note, for AWS we have a good type stubs library that we use instead of doing this. in other cases i have seen use of Protocol
classes to add autocomplete.
anyway, up to you as far as i'm concerned. lemme know your thoughts.
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 agree with your point instead adding method in hook its better to add in operator, it will be lighter weight. But my only doubt can I use client methods in operator, and call the get_conn()
method in operator, no where I can seeing in the repo using client method directly in operator
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.
You can do that, it's no problem at all. It is done for sure.
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.
will do that and raise the PR
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.
@dstandish I have addressed your suggestion, can you please review and approve it
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.
LGTM @dstandish ?
@dstandish Need your review on this comment #24625 (comment) |
@mik-laj @dstandish Need your review on this PR |
I replied to you |
Implement Azure service bus subscription Operators Implement Azure service bus subscription Operators Implement Azure service bus subscription Operators Fix doc string Implement Azure service bus subscription Operators - Added AzureServiceBusSubscriptionCreateOperator - Added AzureServiceBusSubscriptionDeleteOperator -example DAG - Added hooks for creating subscription and delete subscription - Added unit Test case Doc string fix Remove hook method and used client method in operator
b785d4c
to
011fdf6
Compare
cc: @kaxil