-
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 Topic (Create, Delete) Operators #25436
Conversation
bharanidharan14
commented
Aug 1, 2022
•
edited
Loading
edited
- Added AzureServiceBusTopicCreateOperator, AzureServiceBusTopicDeleteOperator to create and delete topic in azure service bus
- Added example to create and delete topic operator in Example DAG
- Added Unit Test case for operators
4b2d2da
to
914e29d
Compare
d71893e
to
fa12cac
Compare
711920a
to
2e7341c
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.
LGTM, one small change plesae
What is the behaviour if the topic you try to create already exists? I'm assuming the underlying hook would fail with an exception, but I think the operator should catch that error so that the operator can be used idempotently: i.e. we should think of the job of this operator to ensure that the specific topic exists. (Similarly for delete operator) |
yes the existing flow will through an error if the topic name exists, Now I have add |
6000ff0
to
6329e3c
Compare
I wonder if there should be a parameter for users to have the option of overwriting a topic that might exist. WDYT? Also, for deleting a topic, if the topic doesn't exist should the task fail? Would it be misleading for a task to succeed if the operation is should perform does not occur and the user didn't explicitly choose to be indifferent about the operation? I could imagine a scenario where users expect to have topics deleted when they aren't even though "Airflow says" the deletion task succeeded. Just some thoughts. |
Not to my mind. Good tasks are idempotent, so deleting a non-existent topic has achieved the goal: to ensure that the topic does not exist. |
Fair point. |
Just thinking, overwriting the existing topic is kind of update operation right ? |
Sure, depending on how Azure Service Bus management operates and/or if someone wanted to patch a particular attribute (if that's even possible). What if you wanted to completely rebuild the topic? Yes, you could check to see if it exists, delete it, and then rebuild it, but I was thinking some analogous feature to file operations. I'm not saying it should or even can be done. I haven't been used ASB in a long time. Just tossing spaghetti to see if it sticks. You can tell me to go back to my corner and it could be something for the future (or never) maybe. |
Yes, there is an Option to patch/update the Topic, I was planning to add update topic operator as next future operator. on that the user can update whatever attribute they want(which is allowed to update). Even I need suggestion this create topic operator should be.
|
2e9de75
to
44ca227
Compare
|
I think option 1 is fine for now. If users find that indeed having option 2 would be helpful, they are more than welcome to log a feature or submit a PR adding the functionality. Thinking about my suggestion, it was a little much and out of scope for the initial creation of these operators. |
44ca227
to
faec19b
Compare
@josh-fell @ashb Can you review this PR, I have addressed the review comments |
Implement Azure Service Bus Topic Create, Delete Operators Implement Azure Service Bus Topic Create, Delete Operators Implement Azure Service Bus Topic Create, Delete Operators Implement Azure Service Bus Topic create Operator - Added Create Topic Operator - Added Test case - Added Example DAG - Added Doc for the operator Doc fix Implemented Azure service bus Topic Delete operator - Added Operator for Delete Topic Operator - Added example DAG Doc fix Doc fix Add check for the existing topic Fix Test case Fix doc string
faec19b
to
32b3d3d
Compare