capo-redshift-data 0.11.0__tar.gz → 0.13.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {capo_redshift_data-0.11.0/src/capo_redshift_data.egg-info → capo_redshift_data-0.13.0}/PKG-INFO +3 -1
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/README.md +2 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/pyproject.toml +1 -1
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_services/_aws_config.py +15 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_services/_pipeline.py +207 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_services/async_redshift_data.py +12 -1
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_services/redshift_data.py +12 -1
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/field.py +12 -12
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/query_records.py +2 -2
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0/src/capo_redshift_data.egg-info}/PKG-INFO +3 -1
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/LICENSE +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/setup.cfg +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/__init__.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_async.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_identity.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_providers.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_signers.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_sigv4.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_zapros_handler.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_aws.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_body.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_iter.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/batch_execute_statement.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/cancel_statement.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/describe_statement.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/describe_table.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/execute_statement.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/get_statement_result.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/get_statement_result_v2.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/list_databases.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/list_schemas.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/list_sessions.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/list_statements.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_operations/redshift_data/list_tables.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_pagination.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/__init__.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/errors.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/eventstream.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/serialize.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/xml.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_rule_engine/__init__.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_rule_engine/_aws_partition.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_rule_engine/_endpoint_rule_set.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_rule_engine/_endpoint_runtime.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/__init__.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/_base.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/active_sessions_exceeded_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/active_statements_exceeded_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/active_waiting_requests_exceeded_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/batch_execute_statement_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/database_connection_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/execute_statement_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/internal_server_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/query_timeout_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/resource_not_found_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/validation_exception.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/py.typed +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/_prelude/blob.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/_prelude/timestamp.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/_unknown.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/batch_execute_statement_input.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/batch_execute_statement_output.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/blob.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/bool.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/boxed_boolean.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/boxed_double.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/boxed_long.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/cancel_statement_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/cancel_statement_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/client_token.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/cluster_identifier_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/column_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/column_metadata.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/column_metadata_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/database_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/db_group_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/describe_statement_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/describe_statement_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/describe_table_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/describe_table_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/execute_statement_input.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/execute_statement_output.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/execution_mode.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/field_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/formatted_sql_records.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/get_statement_result_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/get_statement_result_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/get_statement_result_v2_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/get_statement_result_v2_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/integer.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_databases_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_databases_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_schemas_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_schemas_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_sessions_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_sessions_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_statements_limit.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_statements_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_statements_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_tables_request.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/list_tables_response.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/long.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/page_size.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/parameter_name.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/parameter_value.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/result_format_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/schema_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/secret_arn.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/session_alive_seconds.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/session_data.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/session_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/session_status_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sql_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sql_parameter.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sql_parameters_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sql_records.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/statement_data.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/statement_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/statement_name_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/statement_status_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/statement_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/statement_string_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/status_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sub_statement_data.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sub_statement_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/table_list.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/table_member.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/uuid.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/wait_time_seconds.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/workgroup_name_string.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data.egg-info/SOURCES.txt +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data.egg-info/dependency_links.txt +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data.egg-info/requires.txt +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data.egg-info/top_level.txt +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/tests/test_body.py +0 -0
- {capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/tests/test_sigv4.py +0 -0
{capo_redshift_data-0.11.0/src/capo_redshift_data.egg-info → capo_redshift_data-0.13.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capo-redshift-data
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: Typed, async Python SDK for AWS Redshift Data.
|
|
5
5
|
Project-URL: Homepage, https://capo-sdk.dev/
|
|
6
6
|
Project-URL: Documentation, https://capo-sdk.dev/services/redshift-data/
|
|
@@ -94,6 +94,8 @@ The SDK retries failed operations automatically. Retry behaviour follows the Smi
|
|
|
94
94
|
|
|
95
95
|
The number of attempts defaults to 3 and can be changed at the client level via `retry_max_attempts`, or per call via `config_overrides`.
|
|
96
96
|
|
|
97
|
+
`retry_mode="adaptive"` (or `AWS_RETRY_MODE=adaptive`, or `retry_mode = adaptive` in the AWS profile) also slows the whole client down once the service starts throttling it, then speeds back up as requests succeed. The default is `standard`.
|
|
98
|
+
|
|
97
99
|
```python
|
|
98
100
|
from capo_redshift_data import AsyncRedshiftDataClient
|
|
99
101
|
|
|
@@ -62,6 +62,8 @@ The SDK retries failed operations automatically. Retry behaviour follows the Smi
|
|
|
62
62
|
|
|
63
63
|
The number of attempts defaults to 3 and can be changed at the client level via `retry_max_attempts`, or per call via `config_overrides`.
|
|
64
64
|
|
|
65
|
+
`retry_mode="adaptive"` (or `AWS_RETRY_MODE=adaptive`, or `retry_mode = adaptive` in the AWS profile) also slows the whole client down once the service starts throttling it, then speeds back up as requests succeed. The default is `standard`.
|
|
66
|
+
|
|
65
67
|
```python
|
|
66
68
|
from capo_redshift_data import AsyncRedshiftDataClient
|
|
67
69
|
|
|
@@ -31,6 +31,7 @@ class AwsSettings:
|
|
|
31
31
|
use_fips: bool
|
|
32
32
|
use_dual_stack: bool
|
|
33
33
|
max_attempts: int
|
|
34
|
+
retry_mode: str
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
def _env_bool(name: str) -> bool | None:
|
|
@@ -109,12 +110,22 @@ def load_aws_settings() -> AwsSettings:
|
|
|
109
110
|
use_dual_stack = False
|
|
110
111
|
max_attempts_raw = os.environ.get("AWS_MAX_ATTEMPTS") or profile.get("max_attempts")
|
|
111
112
|
max_attempts = int(max_attempts_raw) if max_attempts_raw else 3
|
|
113
|
+
retry_mode = (
|
|
114
|
+
(os.environ.get("AWS_RETRY_MODE") or profile.get("retry_mode") or "standard")
|
|
115
|
+
.strip()
|
|
116
|
+
.lower()
|
|
117
|
+
)
|
|
118
|
+
if retry_mode not in ("legacy", "standard", "adaptive"):
|
|
119
|
+
raise ValueError(
|
|
120
|
+
f"invalid retry_mode {retry_mode!r}: expected 'legacy', 'standard' or 'adaptive'"
|
|
121
|
+
)
|
|
112
122
|
return AwsSettings(
|
|
113
123
|
region=region,
|
|
114
124
|
endpoint=endpoint,
|
|
115
125
|
use_fips=use_fips,
|
|
116
126
|
use_dual_stack=use_dual_stack,
|
|
117
127
|
max_attempts=max_attempts,
|
|
128
|
+
retry_mode=retry_mode,
|
|
118
129
|
)
|
|
119
130
|
|
|
120
131
|
|
|
@@ -134,6 +145,8 @@ def aws_config() -> Interceptor[TInput, TOutput]:
|
|
|
134
145
|
options.use_dual_stack = settings.use_dual_stack
|
|
135
146
|
if options.retry_max_attempts is None:
|
|
136
147
|
options.retry_max_attempts = settings.max_attempts
|
|
148
|
+
if options.retry_mode is None:
|
|
149
|
+
options.retry_mode = settings.retry_mode
|
|
137
150
|
return next(request)
|
|
138
151
|
|
|
139
152
|
return interceptor
|
|
@@ -155,6 +168,8 @@ def aaws_config() -> AsyncInterceptor[TInput, TOutput]:
|
|
|
155
168
|
options.use_dual_stack = settings.use_dual_stack
|
|
156
169
|
if options.retry_max_attempts is None:
|
|
157
170
|
options.retry_max_attempts = settings.max_attempts
|
|
171
|
+
if options.retry_mode is None:
|
|
172
|
+
options.retry_mode = settings.retry_mode
|
|
158
173
|
return await next(request)
|
|
159
174
|
|
|
160
175
|
return interceptor
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import math
|
|
4
5
|
import random
|
|
5
6
|
import threading
|
|
6
7
|
import time
|
|
@@ -88,15 +89,134 @@ class ThreadSafeRetryQuota(RetryQuota):
|
|
|
88
89
|
super().release(last_retry_cost)
|
|
89
90
|
|
|
90
91
|
|
|
92
|
+
class RateLimiter:
|
|
93
|
+
"""Send tokens shared by all operations of one client in adaptive retry mode: the rate drops on throttling and regrows on success."""
|
|
94
|
+
|
|
95
|
+
MIN_FILL_RATE: float = 0.5
|
|
96
|
+
MIN_CAPACITY: float = 1.0
|
|
97
|
+
BETA: float = 0.7
|
|
98
|
+
SCALE_CONSTANT: float = 0.4
|
|
99
|
+
SMOOTHING: float = 0.8
|
|
100
|
+
MAX_RATE_SCALE: float = 2.0
|
|
101
|
+
|
|
102
|
+
def __init__(self, clock: Callable[[], float] = time.monotonic) -> None:
|
|
103
|
+
self._clock = clock
|
|
104
|
+
now = clock()
|
|
105
|
+
self._enabled: bool = False
|
|
106
|
+
self._fill_rate: float = 1.0
|
|
107
|
+
self._max_capacity: float = 1.0
|
|
108
|
+
self._capacity: float = 0.0
|
|
109
|
+
self._last_refill: float = now
|
|
110
|
+
self._last_max_rate: float = 0.0
|
|
111
|
+
self._last_throttle: float = now
|
|
112
|
+
self._measured_rate: float = 0.0
|
|
113
|
+
self._rate_bucket: float = math.floor(now)
|
|
114
|
+
self._request_count: int = 0
|
|
115
|
+
|
|
116
|
+
def acquire(self) -> float:
|
|
117
|
+
"""Take a send token: return 0, or the seconds to wait before asking again."""
|
|
118
|
+
if not self._enabled:
|
|
119
|
+
return 0.0
|
|
120
|
+
self._refill(self._clock())
|
|
121
|
+
if self._capacity >= 1:
|
|
122
|
+
self._capacity -= 1
|
|
123
|
+
return 0.0
|
|
124
|
+
return (1 - self._capacity) / self._fill_rate
|
|
125
|
+
|
|
126
|
+
def update(self, is_throttling: bool) -> None:
|
|
127
|
+
"""Adjust the send rate after an attempt: cut it on throttling, regrow it otherwise."""
|
|
128
|
+
now = self._clock()
|
|
129
|
+
self._measure(now)
|
|
130
|
+
self._adjust(is_throttling, now)
|
|
131
|
+
|
|
132
|
+
def throttled_mid_stream(self) -> None:
|
|
133
|
+
"""Cut the send rate for throttling reported inside an open event stream. No new request was sent, so the measured rate is left alone."""
|
|
134
|
+
self._adjust(True, self._clock())
|
|
135
|
+
|
|
136
|
+
def _adjust(self, is_throttling: bool, now: float) -> None:
|
|
137
|
+
if is_throttling:
|
|
138
|
+
rate = (
|
|
139
|
+
min(self._measured_rate, self._fill_rate)
|
|
140
|
+
if self._enabled
|
|
141
|
+
else self._measured_rate
|
|
142
|
+
)
|
|
143
|
+
self._last_max_rate = rate
|
|
144
|
+
self._last_throttle = now
|
|
145
|
+
new_rate = rate * self.BETA
|
|
146
|
+
self._enabled = True
|
|
147
|
+
else:
|
|
148
|
+
window = (self._last_max_rate * (1 - self.BETA) / self.SCALE_CONSTANT) ** (
|
|
149
|
+
1 / 3
|
|
150
|
+
)
|
|
151
|
+
new_rate = (
|
|
152
|
+
self.SCALE_CONSTANT * (now - self._last_throttle - window) ** 3
|
|
153
|
+
+ self._last_max_rate
|
|
154
|
+
)
|
|
155
|
+
self._set_rate(min(new_rate, self.MAX_RATE_SCALE * self._measured_rate), now)
|
|
156
|
+
if is_throttling:
|
|
157
|
+
logger.debug(
|
|
158
|
+
"throttled, send rate lowered to %.2f requests/s",
|
|
159
|
+
self._fill_rate,
|
|
160
|
+
extra={"send_rate": self._fill_rate},
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
def _refill(self, now: float) -> None:
|
|
164
|
+
self._capacity = min(
|
|
165
|
+
self._max_capacity,
|
|
166
|
+
self._capacity + (now - self._last_refill) * self._fill_rate,
|
|
167
|
+
)
|
|
168
|
+
self._last_refill = now
|
|
169
|
+
|
|
170
|
+
def _measure(self, now: float) -> None:
|
|
171
|
+
# Requests per second, counted in half-second buckets and smoothed.
|
|
172
|
+
bucket = math.floor(now * 2) / 2
|
|
173
|
+
self._request_count += 1
|
|
174
|
+
if bucket > self._rate_bucket:
|
|
175
|
+
current = self._request_count / (bucket - self._rate_bucket)
|
|
176
|
+
self._measured_rate = current * self.SMOOTHING + self._measured_rate * (
|
|
177
|
+
1 - self.SMOOTHING
|
|
178
|
+
)
|
|
179
|
+
self._request_count = 0
|
|
180
|
+
self._rate_bucket = bucket
|
|
181
|
+
|
|
182
|
+
def _set_rate(self, rate: float, now: float) -> None:
|
|
183
|
+
self._refill(now)
|
|
184
|
+
self._fill_rate = max(rate, self.MIN_FILL_RATE)
|
|
185
|
+
self._max_capacity = max(rate, self.MIN_CAPACITY)
|
|
186
|
+
self._capacity = min(self._capacity, self._max_capacity)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class ThreadSafeRateLimiter(RateLimiter):
|
|
190
|
+
"""A ``RateLimiter`` that sync clients can share across threads."""
|
|
191
|
+
|
|
192
|
+
def __init__(self, clock: Callable[[], float] = time.monotonic) -> None:
|
|
193
|
+
super().__init__(clock)
|
|
194
|
+
self._lock: threading.Lock = threading.Lock()
|
|
195
|
+
|
|
196
|
+
def acquire(self) -> float:
|
|
197
|
+
with self._lock:
|
|
198
|
+
return super().acquire()
|
|
199
|
+
|
|
200
|
+
def update(self, is_throttling: bool) -> None:
|
|
201
|
+
with self._lock:
|
|
202
|
+
super().update(is_throttling)
|
|
203
|
+
|
|
204
|
+
def throttled_mid_stream(self) -> None:
|
|
205
|
+
with self._lock:
|
|
206
|
+
super().throttled_mid_stream()
|
|
207
|
+
|
|
208
|
+
|
|
91
209
|
@dataclass
|
|
92
210
|
class OperationOptions:
|
|
93
211
|
client: Client
|
|
94
212
|
retry_quota: RetryQuota
|
|
213
|
+
rate_limiter: RateLimiter
|
|
95
214
|
use_dual_stack: bool | None = None
|
|
96
215
|
use_fips: bool | None = None
|
|
97
216
|
region: str | None = None
|
|
98
217
|
endpoint: str | None = None
|
|
99
218
|
retry_max_attempts: int | None = None
|
|
219
|
+
retry_mode: str | None = None
|
|
100
220
|
credentials_provider: IdentityProvider[Credentials] | None = None
|
|
101
221
|
anonymous: bool | None = None
|
|
102
222
|
|
|
@@ -105,11 +225,13 @@ class OperationOptions:
|
|
|
105
225
|
class AsyncOperationOptions:
|
|
106
226
|
client: AsyncClient
|
|
107
227
|
retry_quota: RetryQuota
|
|
228
|
+
rate_limiter: RateLimiter
|
|
108
229
|
use_dual_stack: bool | None = None
|
|
109
230
|
use_fips: bool | None = None
|
|
110
231
|
region: str | None = None
|
|
111
232
|
endpoint: str | None = None
|
|
112
233
|
retry_max_attempts: int | None = None
|
|
234
|
+
retry_mode: str | None = None
|
|
113
235
|
credentials_provider: IdentityProvider[Credentials] | None = None
|
|
114
236
|
anonymous: bool | None = None
|
|
115
237
|
|
|
@@ -428,6 +550,91 @@ def aretry() -> AsyncInterceptor[TInput, TOutput]:
|
|
|
428
550
|
return interceptor
|
|
429
551
|
|
|
430
552
|
|
|
553
|
+
def rate_limit() -> Interceptor[TInput, TOutput]:
|
|
554
|
+
def interceptor(
|
|
555
|
+
request: OperationRequest[TInput], next: NextFn[TInput, TOutput]
|
|
556
|
+
) -> OperationResponse[TOutput]:
|
|
557
|
+
if request.options.retry_mode != "adaptive":
|
|
558
|
+
return next(request)
|
|
559
|
+
limiter = request.options.rate_limiter
|
|
560
|
+
while (wait := limiter.acquire()) > 0:
|
|
561
|
+
time.sleep(wait)
|
|
562
|
+
try:
|
|
563
|
+
response = next(request)
|
|
564
|
+
except Exception as exc:
|
|
565
|
+
limiter.update(isinstance(exc, ServiceError) and exc.is_throttling_error)
|
|
566
|
+
raise
|
|
567
|
+
limiter.update(False)
|
|
568
|
+
return response
|
|
569
|
+
|
|
570
|
+
return interceptor
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
def arate_limit() -> AsyncInterceptor[TInput, TOutput]:
|
|
574
|
+
async def interceptor(
|
|
575
|
+
request: AsyncOperationRequest[TInput], next: AsyncNextFn[TInput, TOutput]
|
|
576
|
+
) -> AsyncOperationResponse[TOutput]:
|
|
577
|
+
if request.options.retry_mode != "adaptive":
|
|
578
|
+
return await next(request)
|
|
579
|
+
limiter = request.options.rate_limiter
|
|
580
|
+
while (wait := limiter.acquire()) > 0:
|
|
581
|
+
await anysleep(wait)
|
|
582
|
+
try:
|
|
583
|
+
response = await next(request)
|
|
584
|
+
except Exception as exc:
|
|
585
|
+
limiter.update(isinstance(exc, ServiceError) and exc.is_throttling_error)
|
|
586
|
+
raise
|
|
587
|
+
limiter.update(False)
|
|
588
|
+
return response
|
|
589
|
+
|
|
590
|
+
return interceptor
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
def _on_event_stream_error(
|
|
594
|
+
exc: ServiceError, options: OperationOptions | AsyncOperationOptions
|
|
595
|
+
) -> None:
|
|
596
|
+
# An error event arrives after a 200 response, so raise_error never saw it:
|
|
597
|
+
# mark it by its code here. It is not retried, but adaptive mode slows down.
|
|
598
|
+
_apply_retry_rules(exc, exc.response)
|
|
599
|
+
if exc.is_throttling_error and options.retry_mode == "adaptive":
|
|
600
|
+
options.rate_limiter.throttled_mid_stream()
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
def watch_event_stream(output: Any, member: str, options: OperationOptions) -> None:
|
|
604
|
+
"""Wrap the event stream ``output[member]`` so the errors it raises get their retry flags and reach the rate limiter."""
|
|
605
|
+
if member not in output:
|
|
606
|
+
return
|
|
607
|
+
events = output[member]
|
|
608
|
+
|
|
609
|
+
def watched() -> Iterator[Any]:
|
|
610
|
+
try:
|
|
611
|
+
yield from events
|
|
612
|
+
except ServiceError as exc:
|
|
613
|
+
_on_event_stream_error(exc, options)
|
|
614
|
+
raise
|
|
615
|
+
|
|
616
|
+
output[member] = watched()
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
def awatch_event_stream(
|
|
620
|
+
output: Any, member: str, options: AsyncOperationOptions
|
|
621
|
+
) -> None:
|
|
622
|
+
"""Wrap the event stream ``output[member]`` so the errors it raises get their retry flags and reach the rate limiter."""
|
|
623
|
+
if member not in output:
|
|
624
|
+
return
|
|
625
|
+
events = output[member]
|
|
626
|
+
|
|
627
|
+
async def watched() -> AsyncIterator[Any]:
|
|
628
|
+
try:
|
|
629
|
+
async for event in events:
|
|
630
|
+
yield event
|
|
631
|
+
except ServiceError as exc:
|
|
632
|
+
_on_event_stream_error(exc, options)
|
|
633
|
+
raise
|
|
634
|
+
|
|
635
|
+
output[member] = watched()
|
|
636
|
+
|
|
637
|
+
|
|
431
638
|
def log_operation(operation_logging: OperationLogging) -> Interceptor[TInput, TOutput]:
|
|
432
639
|
operation = operation_logging.operation
|
|
433
640
|
redact_input = operation_logging.redact_input
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import uuid
|
|
4
4
|
import warnings
|
|
5
5
|
from collections.abc import AsyncIterator
|
|
6
|
-
from typing import TYPE_CHECKING, Any, Iterable, Optional
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Iterable, Literal, Optional
|
|
7
7
|
|
|
8
8
|
from typing_extensions import Self, TypedDict
|
|
9
9
|
from zapros import AsyncBaseHandler, AsyncClient
|
|
@@ -26,9 +26,11 @@ from capo_redshift_data._services._pipeline import (
|
|
|
26
26
|
AsyncOperationRequest,
|
|
27
27
|
AsyncOperationResponse,
|
|
28
28
|
OperationLogging,
|
|
29
|
+
RateLimiter,
|
|
29
30
|
RetryQuota,
|
|
30
31
|
aexecute_pipeline,
|
|
31
32
|
alog_operation,
|
|
33
|
+
arate_limit,
|
|
32
34
|
aretry,
|
|
33
35
|
)
|
|
34
36
|
|
|
@@ -86,6 +88,7 @@ if TYPE_CHECKING:
|
|
|
86
88
|
class AsyncRedshiftDataClientConfig(TypedDict, total=False, closed=True):
|
|
87
89
|
operation_interceptors: Iterable[AsyncInterceptor[Any, Any]]
|
|
88
90
|
retry_max_attempts: int | None
|
|
91
|
+
retry_mode: Literal["standard", "adaptive"] | None
|
|
89
92
|
region: str | None
|
|
90
93
|
use_dual_stack: bool | None
|
|
91
94
|
use_fips: bool | None
|
|
@@ -101,6 +104,7 @@ class AsyncRedshiftDataClient:
|
|
|
101
104
|
http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
|
|
102
105
|
operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
|
|
103
106
|
retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
|
|
107
|
+
retry_mode: ``"standard"`` (the default) or ``"adaptive"``, which also slows the whole client down when the service throttles it.
|
|
104
108
|
region: The value of the ``AWS::Region`` endpoint parameter.
|
|
105
109
|
use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
|
|
106
110
|
use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
|
|
@@ -115,6 +119,7 @@ class AsyncRedshiftDataClient:
|
|
|
115
119
|
http_handler: AsyncBaseHandler | None = None,
|
|
116
120
|
operation_interceptors: Iterable[AsyncInterceptor[Any, Any]] | None = None,
|
|
117
121
|
retry_max_attempts: int | None = None,
|
|
122
|
+
retry_mode: Literal["standard", "adaptive"] | None = None,
|
|
118
123
|
region: str | None = None,
|
|
119
124
|
use_dual_stack: bool | None = None,
|
|
120
125
|
use_fips: bool | None = None,
|
|
@@ -131,6 +136,8 @@ class AsyncRedshiftDataClient:
|
|
|
131
136
|
self._client = client.wrap_with_middleware(lambda next: AuthMiddleware(next))
|
|
132
137
|
# One retry quota for all of this client's operations.
|
|
133
138
|
self._retry_quota = RetryQuota()
|
|
139
|
+
# One send-rate limiter too, used when retry_mode is adaptive.
|
|
140
|
+
self._rate_limiter = RateLimiter()
|
|
134
141
|
if credentials is not None and credentials_provider is not None:
|
|
135
142
|
warnings.warn(
|
|
136
143
|
"Both credentials and credentials_provider given; provider takes precedence"
|
|
@@ -148,6 +155,7 @@ class AsyncRedshiftDataClient:
|
|
|
148
155
|
{
|
|
149
156
|
"operation_interceptors": operation_interceptors or [],
|
|
150
157
|
"retry_max_attempts": retry_max_attempts,
|
|
158
|
+
"retry_mode": retry_mode,
|
|
151
159
|
"region": region,
|
|
152
160
|
"use_dual_stack": use_dual_stack,
|
|
153
161
|
"use_fips": use_fips,
|
|
@@ -172,12 +180,15 @@ class AsyncRedshiftDataClient:
|
|
|
172
180
|
if operation_logging is not None:
|
|
173
181
|
interceptors_.append(alog_operation(operation_logging))
|
|
174
182
|
interceptors_.append(aretry())
|
|
183
|
+
interceptors_.append(arate_limit())
|
|
175
184
|
options_: AsyncOperationOptions = AsyncOperationOptions(
|
|
176
185
|
client=self._client,
|
|
177
186
|
retry_quota=self._retry_quota,
|
|
187
|
+
rate_limiter=self._rate_limiter,
|
|
178
188
|
retry_max_attempts=overrides.get(
|
|
179
189
|
"retry_max_attempts", self._config.get("retry_max_attempts")
|
|
180
190
|
),
|
|
191
|
+
retry_mode=overrides.get("retry_mode", self._config.get("retry_mode")),
|
|
181
192
|
region=overrides.get("region", self._config.get("region")),
|
|
182
193
|
use_dual_stack=overrides.get(
|
|
183
194
|
"use_dual_stack", self._config.get("use_dual_stack")
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import uuid
|
|
4
4
|
import warnings
|
|
5
5
|
from collections.abc import Iterator
|
|
6
|
-
from typing import TYPE_CHECKING, Any, Iterable, Optional
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Iterable, Literal, Optional
|
|
7
7
|
|
|
8
8
|
from typing_extensions import Self, TypedDict
|
|
9
9
|
from zapros import BaseHandler, Client
|
|
@@ -26,9 +26,11 @@ from capo_redshift_data._services._pipeline import (
|
|
|
26
26
|
OperationOptions,
|
|
27
27
|
OperationRequest,
|
|
28
28
|
OperationResponse,
|
|
29
|
+
ThreadSafeRateLimiter,
|
|
29
30
|
ThreadSafeRetryQuota,
|
|
30
31
|
execute_pipeline,
|
|
31
32
|
log_operation,
|
|
33
|
+
rate_limit,
|
|
32
34
|
retry,
|
|
33
35
|
)
|
|
34
36
|
|
|
@@ -86,6 +88,7 @@ if TYPE_CHECKING:
|
|
|
86
88
|
class RedshiftDataClientConfig(TypedDict, total=False, closed=True):
|
|
87
89
|
operation_interceptors: Iterable[Interceptor[Any, Any]]
|
|
88
90
|
retry_max_attempts: int | None
|
|
91
|
+
retry_mode: Literal["standard", "adaptive"] | None
|
|
89
92
|
region: str | None
|
|
90
93
|
use_dual_stack: bool | None
|
|
91
94
|
use_fips: bool | None
|
|
@@ -101,6 +104,7 @@ class RedshiftDataClient:
|
|
|
101
104
|
http_handler: HTTP handler for sending requests. If not provided, creates a default handler.
|
|
102
105
|
operation_interceptors: Interceptors that wrap every operation call. If not provided, defaults to an empty list.
|
|
103
106
|
retry_max_attempts: Maximum number of times to retry a failed operation. Defaults to 3.
|
|
107
|
+
retry_mode: ``"standard"`` (the default) or ``"adaptive"``, which also slows the whole client down when the service throttles it.
|
|
104
108
|
region: The value of the ``AWS::Region`` endpoint parameter.
|
|
105
109
|
use_dual_stack: The value of the ``AWS::UseDualStack`` endpoint parameter.
|
|
106
110
|
use_fips: The value of the ``AWS::UseFIPS`` endpoint parameter.
|
|
@@ -115,6 +119,7 @@ class RedshiftDataClient:
|
|
|
115
119
|
http_handler: BaseHandler | None = None,
|
|
116
120
|
operation_interceptors: Iterable[Interceptor[Any, Any]] | None = None,
|
|
117
121
|
retry_max_attempts: int | None = None,
|
|
122
|
+
retry_mode: Literal["standard", "adaptive"] | None = None,
|
|
118
123
|
region: str | None = None,
|
|
119
124
|
use_dual_stack: bool | None = None,
|
|
120
125
|
use_fips: bool | None = None,
|
|
@@ -131,6 +136,8 @@ class RedshiftDataClient:
|
|
|
131
136
|
self._client = client.wrap_with_middleware(lambda next: AuthMiddleware(next))
|
|
132
137
|
# One retry quota for all of this client's operations.
|
|
133
138
|
self._retry_quota = ThreadSafeRetryQuota()
|
|
139
|
+
# One send-rate limiter too, used when retry_mode is adaptive.
|
|
140
|
+
self._rate_limiter = ThreadSafeRateLimiter()
|
|
134
141
|
if credentials is not None and credentials_provider is not None:
|
|
135
142
|
warnings.warn(
|
|
136
143
|
"Both credentials and credentials_provider given; provider takes precedence"
|
|
@@ -148,6 +155,7 @@ class RedshiftDataClient:
|
|
|
148
155
|
{
|
|
149
156
|
"operation_interceptors": operation_interceptors or [],
|
|
150
157
|
"retry_max_attempts": retry_max_attempts,
|
|
158
|
+
"retry_mode": retry_mode,
|
|
151
159
|
"region": region,
|
|
152
160
|
"use_dual_stack": use_dual_stack,
|
|
153
161
|
"use_fips": use_fips,
|
|
@@ -172,12 +180,15 @@ class RedshiftDataClient:
|
|
|
172
180
|
if operation_logging is not None:
|
|
173
181
|
interceptors_.append(log_operation(operation_logging))
|
|
174
182
|
interceptors_.append(retry())
|
|
183
|
+
interceptors_.append(rate_limit())
|
|
175
184
|
options_: OperationOptions = OperationOptions(
|
|
176
185
|
client=self._client,
|
|
177
186
|
retry_quota=self._retry_quota,
|
|
187
|
+
rate_limiter=self._rate_limiter,
|
|
178
188
|
retry_max_attempts=overrides.get(
|
|
179
189
|
"retry_max_attempts", self._config.get("retry_max_attempts")
|
|
180
190
|
),
|
|
191
|
+
retry_mode=overrides.get("retry_mode", self._config.get("retry_mode")),
|
|
181
192
|
region=overrides.get("region", self._config.get("region")),
|
|
182
193
|
use_dual_stack=overrides.get(
|
|
183
194
|
"use_dual_stack", self._config.get("use_dual_stack")
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/field.py
RENAMED
|
@@ -15,37 +15,37 @@ if TYPE_CHECKING:
|
|
|
15
15
|
import capo_redshift_data.types.string
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class
|
|
18
|
+
class FieldIsNullMember(TypedDict, closed=True):
|
|
19
19
|
isNull: "capo_redshift_data.types.boxed_boolean.BoxedBoolean"
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class
|
|
22
|
+
class FieldBooleanValueMember(TypedDict, closed=True):
|
|
23
23
|
booleanValue: "capo_redshift_data.types.boxed_boolean.BoxedBoolean"
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class FieldLongValueMember(TypedDict, closed=True):
|
|
27
27
|
longValue: "capo_redshift_data.types.boxed_long.BoxedLong"
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
class
|
|
30
|
+
class FieldDoubleValueMember(TypedDict, closed=True):
|
|
31
31
|
doubleValue: "capo_redshift_data.types.boxed_double.BoxedDouble"
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
class
|
|
34
|
+
class FieldStringValueMember(TypedDict, closed=True):
|
|
35
35
|
stringValue: "capo_redshift_data.types.string.String"
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
class
|
|
38
|
+
class FieldBlobValueMember(TypedDict, closed=True):
|
|
39
39
|
blobValue: "capo_redshift_data.types.blob.Blob"
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
Field: TypeAlias = (
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
43
|
+
FieldIsNullMember
|
|
44
|
+
| FieldBooleanValueMember
|
|
45
|
+
| FieldLongValueMember
|
|
46
|
+
| FieldDoubleValueMember
|
|
47
|
+
| FieldStringValueMember
|
|
48
|
+
| FieldBlobValueMember
|
|
49
49
|
| UnknownUnionMember
|
|
50
50
|
)
|
|
51
51
|
|
|
@@ -11,11 +11,11 @@ if TYPE_CHECKING:
|
|
|
11
11
|
import capo_redshift_data.types.string
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
class
|
|
14
|
+
class QueryRecordsCSVRecordsMember(TypedDict, closed=True):
|
|
15
15
|
CSVRecords: "capo_redshift_data.types.string.String"
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
QueryRecords: TypeAlias =
|
|
18
|
+
QueryRecords: TypeAlias = QueryRecordsCSVRecordsMember | UnknownUnionMember
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
# --- awsJson1_1 ser/de ---
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0/src/capo_redshift_data.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capo-redshift-data
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: Typed, async Python SDK for AWS Redshift Data.
|
|
5
5
|
Project-URL: Homepage, https://capo-sdk.dev/
|
|
6
6
|
Project-URL: Documentation, https://capo-sdk.dev/services/redshift-data/
|
|
@@ -94,6 +94,8 @@ The SDK retries failed operations automatically. Retry behaviour follows the Smi
|
|
|
94
94
|
|
|
95
95
|
The number of attempts defaults to 3 and can be changed at the client level via `retry_max_attempts`, or per call via `config_overrides`.
|
|
96
96
|
|
|
97
|
+
`retry_mode="adaptive"` (or `AWS_RETRY_MODE=adaptive`, or `retry_mode = adaptive` in the AWS profile) also slows the whole client down once the service starts throttling it, then speeds back up as requests succeed. The default is `standard`.
|
|
98
|
+
|
|
97
99
|
```python
|
|
98
100
|
from capo_redshift_data import AsyncRedshiftDataClient
|
|
99
101
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_identity.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_providers.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_signers.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_auth/_sigv4.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_pagination.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/__init__.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/_protocol/xml.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/__init__.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/errors/_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/_unknown.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/blob.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/bool.py
RENAMED
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/boxed_double.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/boxed_long.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/client_token.py
RENAMED
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/column_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/field_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/integer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/long.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/page_size.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/schema_list.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/secret_arn.py
RENAMED
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/session_data.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/session_list.py
RENAMED
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sql_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/sql_records.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/string.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/table_list.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/table_member.py
RENAMED
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data/types/uuid.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{capo_redshift_data-0.11.0 → capo_redshift_data-0.13.0}/src/capo_redshift_data.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|