Skip to content

Commit a21ac84

Browse files
docs: use autodoc typehints (#2940)
* docs: Add sphinx-autodoc-typehints * s3: remove type hints from function docstrings * catalog: remove type hints from function docstrings * athena: remove type hints from function docstrings * redshift: remove type hints from function docstrings * add sphinx-autodoc-typehints to docs/environment.yml * remove more type hints from function docstrings * fix type hints for sqlserver module * dataapi: remove type hints from function docstrings * data_quality: remove type hints from function docstrings * opensearch: remove type hints from function docstrings * neptune: remove type hints from function docstrings * dynamodb: remove type hints from function docstrings * timestream: remove type hints from function docstrings * emr: remove type hints from function docstrings * cloudwatch: remove type hints from function docstrings * quicksight: remove type hints from function docstrings * fix remaining type hints * fix autodoc type hints for mysql * fix formatting * fix type hints for optional dependencies * set always_use_bars_union * add missing typed dicts
1 parent 9b7f4ea commit a21ac84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2433
-2824
lines changed

awswrangler/_config.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,9 @@ def reset(self, item: str | None = None) -> None:
9696
9797
Parameters
9898
----------
99-
item : str, optional
99+
item
100100
Configuration item name.
101101
102-
Returns
103-
-------
104-
None
105-
None.
106-
107102
Examples
108103
--------
109104
>>> import awswrangler as wr
@@ -122,7 +117,6 @@ def to_pandas(self) -> pd.DataFrame:
122117
123118
Returns
124119
-------
125-
pd.DataFrame
126120
Configuration DataFrame.
127121
128122
Examples

awswrangler/athena/_cache.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ def update_cache(self, items: list[dict[str, Any]]) -> None:
4141
----------
4242
items : List[Dict[str, Any]]
4343
List of query execution metadata which is returned by boto3 `batch_get_query_execution()`.
44-
45-
Returns
46-
-------
47-
None
48-
None.
4944
"""
5045
with self._lock:
5146
if self._pqueue:

awswrangler/athena/_executions.py

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ def start_query_execution(
5656
5757
Parameters
5858
----------
59-
sql : str
59+
sql
6060
SQL query.
61-
database : str, optional
61+
database
6262
AWS Glue/Athena database name.
63-
s3_output : str, optional
63+
s3_output
6464
AWS S3 path.
65-
workgroup : str
65+
workgroup
6666
Athena workgroup. Primary by default.
67-
encryption : str, optional
67+
encryption
6868
None, 'SSE_S3', 'SSE_KMS', 'CSE_KMS'.
69-
kms_key : str, optional
69+
kms_key
7070
For SSE-KMS and CSE-KMS , this is the KMS key ARN or ID.
71-
params: Dict[str, any] | List[str], optional
71+
params
7272
Parameters that will be used for constructing the SQL query.
7373
Only named or question mark parameters are supported.
7474
The parameter style needs to be specified in the ``paramstyle`` parameter.
@@ -81,39 +81,38 @@ def start_query_execution(
8181
For ``paramstyle="qmark"``, this value needs to be a list of strings.
8282
The formatter will be applied server-side.
8383
The values are applied sequentially to the parameters in the query in the order in which the parameters occur.
84-
paramstyle: str, optional
84+
paramstyle
8585
Determines the style of ``params``.
8686
Possible values are:
8787
8888
- ``named``
8989
- ``qmark``
90-
boto3_session : boto3.Session(), optional
91-
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
92-
client_request_token : str, optional
90+
boto3_session
91+
The default boto3 session will be used if **boto3_session** receive ``None``.
92+
client_request_token
9393
A unique case-sensitive string used to ensure the request to create the query is idempotent (executes only once).
9494
If another StartQueryExecution request is received, the same response is returned and another query is not created.
9595
If a parameter has changed, for example, the QueryString , an error is returned.
9696
If you pass the same client_request_token value with different parameters the query fails with error
9797
message "Idempotent parameters do not match". Use this only with ctas_approach=False and unload_approach=False
9898
and disabled cache.
99-
athena_cache_settings: typing.AthenaCacheSettings, optional
99+
athena_cache_settings
100100
Parameters of the Athena cache settings such as max_cache_seconds, max_cache_query_inspections,
101101
max_remote_cache_entries, and max_local_cache_entries.
102102
AthenaCacheSettings is a `TypedDict`, meaning the passed parameter can be instantiated either as an
103103
instance of AthenaCacheSettings or as a regular Python dict.
104104
If cached results are valid, awswrangler ignores the `ctas_approach`, `s3_output`, `encryption`, `kms_key`,
105105
`keep_files` and `ctas_temp_table_name` params.
106106
If reading cached data fails for any reason, execution falls back to the usual query run path.
107-
athena_query_wait_polling_delay: float, default: 1.0 seconds
107+
athena_query_wait_polling_delay
108108
Interval in seconds for how often the function will check if the Athena query has completed.
109-
data_source : str, optional
109+
data_source
110110
Data Source / Catalog name. If None, 'AwsDataCatalog' will be used by default.
111-
wait : bool, default False
111+
wait
112112
Indicates whether to wait for the query to finish and return a dictionary with the query execution response.
113113
114114
Returns
115115
-------
116-
Union[str, Dict[str, Any]]
117116
Query execution ID if `wait` is set to `False`, dictionary with the get_query_execution response otherwise.
118117
119118
Examples
@@ -177,15 +176,10 @@ def stop_query_execution(query_execution_id: str, boto3_session: boto3.Session |
177176
178177
Parameters
179178
----------
180-
query_execution_id : str
179+
query_execution_id
181180
Athena query execution ID.
182-
boto3_session : boto3.Session(), optional
183-
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
184-
185-
Returns
186-
-------
187-
None
188-
None.
181+
boto3_session
182+
The default boto3 session will be used if **boto3_session** receive ``None``.
189183
190184
Examples
191185
--------
@@ -207,16 +201,15 @@ def wait_query(
207201
208202
Parameters
209203
----------
210-
query_execution_id : str
204+
query_execution_id
211205
Athena query execution ID.
212-
boto3_session : boto3.Session(), optional
213-
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
214-
athena_query_wait_polling_delay: float, default: 1.0 seconds
206+
boto3_session
207+
The default boto3 session will be used if **boto3_session** receive ``None``.
208+
athena_query_wait_polling_delay
215209
Interval in seconds for how often the function will check if the Athena query has completed.
216210
217211
Returns
218212
-------
219-
Dict[str, Any]
220213
Dictionary with the get_query_execution response.
221214
222215
Examples
@@ -247,14 +240,13 @@ def get_query_execution(query_execution_id: str, boto3_session: boto3.Session |
247240
248241
Parameters
249242
----------
250-
query_execution_id : str
243+
query_execution_id
251244
Athena query execution ID.
252-
boto3_session : boto3.Session(), optional
253-
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
245+
boto3_session
246+
The default boto3 session will be used if **boto3_session** receive ``None``.
254247
255248
Returns
256249
-------
257-
Dict[str, Any]
258250
Dictionary with the get_query_execution response.
259251
260252
Examples

0 commit comments

Comments
 (0)