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

Implement Azure service bus subscription (create, delete)Operators #24625

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

bharanidharan14
Copy link
Contributor

@bharanidharan14 bharanidharan14 commented Jun 24, 2022

  • Added AzureServiceBusSubscriptionCreateOperator, AzureServiceBusSubscriptionDeleteOperator to create and delete subscription under topic in azure service bus
  • Added example to create and delete subscription operator in Example DAG
  • Added hooks for creating subscription and delete subscription under the topic
  • Added unit Test case for operator and hook

cc: @kaxil

@bharanidharan14
Copy link
Contributor Author

Created PR for Azure service bus subscription(create, delete) operator
cc: @ashb @kaxil @phanikumv @eladkal @josh-fell

@@ -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(
Copy link
Contributor

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

Copy link
Contributor Author

@bharanidharan14 bharanidharan14 Jul 7, 2022

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 ?

Copy link
Contributor

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.

Copy link
Contributor Author

@bharanidharan14 bharanidharan14 Jul 12, 2022

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@bharanidharan14 bharanidharan14 requested a review from dstandish July 7, 2022 04:26
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

LGTM @dstandish ?

@bharanidharan14
Copy link
Contributor Author

bharanidharan14 commented Jul 12, 2022

@dstandish Need your review on this comment #24625 (comment)

@bharanidharan14
Copy link
Contributor Author

@mik-laj @dstandish Need your review on this PR

@dstandish
Copy link
Contributor

@dstandish Need your review on this comment #24625 (comment)

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
@bharanidharan14 bharanidharan14 force-pushed the asb-subscription-mgmt-operators branch from b785d4c to 011fdf6 Compare July 12, 2022 17:41
@potiuk potiuk merged commit aa8bf2c into apache:main Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants