-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Extend hooks arguments into AwsBaseWaiterTrigger
#34884
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
Changes from all commits
997495d
18a5690
d2e56ed
903c2c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,41 @@ def test_region_serialized(self): | |
| assert "region_name" in args | ||
| assert args["region_name"] == "my_region" | ||
|
|
||
| def test_region_not_serialized_if_omitted(self): | ||
| @pytest.mark.parametrize("verify", [True, False, pytest.param("/foo/bar.pem", id="path")]) | ||
| def test_verify_serialized(self, verify): | ||
| self.trigger.verify = verify | ||
| _, args = self.trigger.serialize() | ||
|
|
||
| assert "verify" in args | ||
| assert args["verify"] == verify | ||
|
|
||
| @pytest.mark.parametrize( | ||
| "botocore_config", | ||
| [ | ||
| pytest.param({"read_timeout": 10, "connect_timeout": 42, "keepalive": True}, id="non-empty-dict"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have such example exposed in the docs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not yet. Let's add it with first migrated Operators.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea create similar RST file as https://github.com/apache/airflow/blob/main/docs/apache-airflow-providers-amazon/_partials/prerequisite_tasks.rst
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's best to create doc for the base class rather than add the example to all/selected operators
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah we could create page for base boto3 based operators.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a plan create some draft PR during the day, so we could discuss documentation there
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cool so lets merge? |
||
| pytest.param({}, id="empty-dict"), | ||
| ], | ||
| ) | ||
| def test_botocore_config_serialized(self, botocore_config): | ||
| self.trigger.botocore_config = botocore_config | ||
| _, args = self.trigger.serialize() | ||
|
|
||
| assert "botocore_config" in args | ||
| assert args["botocore_config"] == botocore_config | ||
|
|
||
| @pytest.mark.parametrize("param_name", ["region_name", "verify", "botocore_config"]) | ||
| def test_hooks_args_not_serialized_if_omitted(self, param_name): | ||
| _, args = self.trigger.serialize() | ||
|
|
||
| assert param_name not in args | ||
|
|
||
| def test_region_name_not_serialized_if_empty_string(self): | ||
| """ | ||
| Compatibility with previous behaviour when empty string region name not serialised. | ||
|
|
||
| It would evaluate as None, however empty string it is not valid region name in boto3. | ||
| """ | ||
| self.trigger.region_name = "" | ||
| _, args = self.trigger.serialize() | ||
|
|
||
| assert "region_name" not in args | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.