Skip to content

Commit 8ea7427

Browse files
docs: Fix enumerations in doc pages (#2821)
1 parent 6ed9850 commit 8ea7427

File tree

4 files changed

+51
-44
lines changed

4 files changed

+51
-44
lines changed

awswrangler/athena/_statements.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def create_prepared_statement(
5959
6060
- ``update`` - updates statement if already exists
6161
- ``error`` - throws an error if table exists
62+
6263
boto3_session : boto3.Session(), optional
6364
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
6465

awswrangler/postgresql.py

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -528,38 +528,44 @@ def to_sql(
528528
529529
Parameters
530530
----------
531-
df : pandas.DataFrame
532-
Pandas DataFrame https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
533-
con : pg8000.Connection
534-
Use pg8000.connect() to use credentials directly or wr.postgresql.connect() to fetch it from the Glue Catalog.
535-
table : str
531+
df: pandas.DataFrame
532+
`Pandas DataFrame <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html>`_
533+
con: pg8000.Connection
534+
Use ``pg8000.connect()`` to use credentials directly or ``wr.postgresql.connect()`` to fetch it from the Glue Catalog.
535+
table: str
536536
Table name
537-
schema : str
537+
schema: str
538538
Schema name
539-
mode : str
539+
mode: str
540540
Append, overwrite or upsert.
541-
append: Inserts new records into table.
542-
overwrite: Drops table and recreates.
543-
upsert: Perform an upsert which checks for conflicts on columns given by `upsert_conflict_columns` and
544-
sets the new values on conflicts. Note that `upsert_conflict_columns` is required for this mode.
545-
overwrite_method : str
541+
542+
- append: Inserts new records into table.
543+
- overwrite: Drops table and recreates.
544+
- upsert: Perform an upsert which checks for conflicts on columns given by ``upsert_conflict_columns`` and
545+
sets the new values on conflicts. Note that ``upsert_conflict_columns`` is required for this mode.
546+
547+
overwrite_method: str
546548
Drop, cascade, truncate, or truncate cascade. Only applicable in overwrite mode.
547549
548-
"drop" - ``DROP ... RESTRICT`` - drops the table. Fails if there are any views that depend on it.
549-
"cascade" - ``DROP ... CASCADE`` - drops the table, and all views that depend on it.
550-
"truncate" - ``TRUNCATE ... RESTRICT`` - truncates the table. Fails if any of the tables have foreign-key references from tables that are not listed in the command.
551-
"truncate cascade" - ``TRUNCATE ... CASCADE`` - truncates the table, and all tables that have foreign-key references to any of the named tables.
552-
index : bool
550+
- "drop" - ``DROP ... RESTRICT`` - drops the table. Fails if there are any views that depend on it.
551+
- "cascade" - ``DROP ... CASCADE`` - drops the table, and all views that depend on it.
552+
- "truncate" - ``TRUNCATE ... RESTRICT`` - truncates the table.
553+
Fails if any of the tables have foreign-key references from tables that are not listed in the command.
554+
- "truncate cascade" - ``TRUNCATE ... CASCADE`` - truncates the table, and all tables that have
555+
foreign-key references to any of the named tables.
556+
557+
index: bool
553558
True to store the DataFrame index as a column in the table,
554559
otherwise False to ignore it.
555560
dtype: Dict[str, str], optional
556561
Dictionary of columns names and PostgreSQL types to be casted.
557562
Useful when you have columns with undetermined or mixed data types.
558-
(e.g. {'col name': 'TEXT', 'col2 name': 'FLOAT'})
559-
varchar_lengths : Dict[str, int], optional
560-
Dict of VARCHAR length by columns. (e.g. {"col1": 10, "col5": 200}).
563+
(e.g. ``{'col name': 'TEXT', 'col2 name': 'FLOAT'}``)
564+
varchar_lengths: Dict[str, int], optional
565+
Dict of VARCHAR length by columns. (e.g. ``{"col1": 10, "col5": 200}``).
561566
use_column_names: bool
562567
If set to True, will use the column names of the DataFrame for generating the INSERT SQL Query.
568+
563569
E.g. If the DataFrame has two columns `col1` and `col3` and `use_column_names` is True, data will only be
564570
inserted into the database columns `col1` and `col3`.
565571
chunksize: int
@@ -583,14 +589,13 @@ def to_sql(
583589
Writing to PostgreSQL using a Glue Catalog Connections
584590
585591
>>> import awswrangler as wr
586-
>>> con = wr.postgresql.connect("MY_GLUE_CONNECTION")
587-
>>> wr.postgresql.to_sql(
588-
... df=df,
589-
... table="my_table",
590-
... schema="public",
591-
... con=con
592-
... )
593-
>>> con.close()
592+
>>> with wr.postgresql.connect("MY_GLUE_CONNECTION") as con:
593+
... wr.postgresql.to_sql(
594+
... df=df,
595+
... table="my_table",
596+
... schema="public",
597+
... con=con
598+
... )
594599
595600
"""
596601
if df.empty is True:

awswrangler/redshift/_write.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ def to_sql(
111111
overwrite_method : str
112112
Drop, cascade, truncate, or delete. Only applicable in overwrite mode.
113113
114-
"drop" - ``DROP ... RESTRICT`` - drops the table. Fails if there are any views that depend on it.
115-
"cascade" - ``DROP ... CASCADE`` - drops the table, and all views that depend on it.
116-
"truncate" - ``TRUNCATE ...`` - truncates the table, but immediately commits current
117-
transaction & starts a new one, hence the overwrite happens in two transactions and is not atomic.
118-
"delete" - ``DELETE FROM ...`` - deletes all rows from the table. Slow relative to the other methods.
114+
- "drop" - ``DROP ... RESTRICT`` - drops the table. Fails if there are any views that depend on it.
115+
- "cascade" - ``DROP ... CASCADE`` - drops the table, and all views that depend on it.
116+
- "truncate" - ``TRUNCATE ...`` - truncates the table, but immediately commits current transaction &
117+
starts a new one, hence the overwrite happens in two transactions and is not atomic.
118+
- "delete" - ``DELETE FROM ...`` - deletes all rows from the table. Slow relative to the other methods.
119+
119120
index : bool
120121
True to store the DataFrame index as a column in the table,
121122
otherwise False to ignore it.

awswrangler/s3/_copy.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,27 +201,27 @@ def copy_objects(
201201
Note
202202
----
203203
In case of `use_threads=True` the number of threads
204-
that will be spawned will be gotten from os.cpu_count().
204+
that will be spawned will be gotten from `os.cpu_count()`.
205205
206206
Parameters
207207
----------
208-
paths : List[str]
209-
List of S3 objects paths (e.g. [s3://bucket/dir0/key0, s3://bucket/dir0/key1]).
210-
source_path : str,
208+
paths: List[str]
209+
List of S3 objects paths (e.g. ``["s3://bucket/dir0/key0", "s3://bucket/dir0/key1"]``).
210+
source_path: str
211211
S3 Path for the source directory.
212-
target_path : str,
212+
target_path: str
213213
S3 Path for the target directory.
214-
replace_filenames : Dict[str, str], optional
215-
e.g. {"old_name.csv": "new_name.csv", "old_name2.csv": "new_name2.csv"}
216-
use_threads : bool, int
214+
replace_filenames: Dict[str, str], optional
215+
e.g. ``{"old_name.csv": "new_name.csv", "old_name2.csv": "new_name2.csv"}``
216+
use_threads: bool, int
217217
True to enable concurrent requests, False to disable multiple threads.
218-
If enabled os.cpu_count() will be used as the max number of threads.
218+
If enabled ``os.cpu_count()`` will be used as the max number of threads.
219219
If integer is provided, specified number is used.
220-
boto3_session : boto3.Session(), optional
220+
boto3_session: boto3.Session(), optional
221221
Boto3 Session. The default boto3 session will be used if boto3_session receive None.
222222
s3_additional_kwargs: dict[str, Any], optional
223223
Forwarded to botocore requests.
224-
e.g. s3_additional_kwargs={'ServerSideEncryption': 'aws:kms', 'SSEKMSKeyId': 'YOUR_KMS_KEY_ARN'}
224+
e.g. ``s3_additional_kwargs={'ServerSideEncryption': 'aws:kms', 'SSEKMSKeyId': 'YOUR_KMS_KEY_ARN'}``
225225
226226
Returns
227227
-------

0 commit comments

Comments
 (0)