Skip to content

Commit f0ccf2b

Browse files
committed
Formatted docstrings to flake8
1 parent eb09179 commit f0ccf2b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

awswrangler/catalog/_utils.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def sanitize_dataframe_columns_names(
194194
How to handle duplicate columns. Can be "warn" or "drop" or "rename".
195195
The default is "warn". "drop" will drop all but the first duplicated column.
196196
"rename" will rename all duplicated columns with an incremental number.
197+
197198
Returns
198199
-------
199200
pandas.DataFrame
@@ -202,13 +203,18 @@ def sanitize_dataframe_columns_names(
202203
Examples
203204
--------
204205
>>> import awswrangler as wr
205-
>>> df_normalized = wr.catalog.sanitize_dataframe_columns_names(df=pd.DataFrame({'A': [1, 2]}))
206-
>>> df_normalized_drop = wr.catalog.sanitize_dataframe_columns_names(df=pd.DataFrame({'A': [1, 2], 'a': [3, 4]}), handle_duplicate_columns="drop")
207-
>>> df_normalized_rename = wr.catalog.sanitize_dataframe_columns_names(df=pd.DataFrame({'A': [1, 2], 'a': [3, 4], 'a_1': [4, 6]}), handle_duplicate_columns="rename")
206+
>>> df_normalized = wr.catalog.sanitize_dataframe_columns_names(df=pd.DataFrame({"A": [1, 2]}))
207+
>>> df_normalized_drop = wr.catalog.sanitize_dataframe_columns_names(
208+
df=pd.DataFrame({"A": [1, 2], "a": [3, 4]}), handle_duplicate_columns="drop"
209+
)
210+
>>> df_normalized_rename = wr.catalog.sanitize_dataframe_columns_names(
211+
df=pd.DataFrame({"A": [1, 2], "a": [3, 4], "a_1": [4, 6]}), handle_duplicate_columns="rename"
212+
)
213+
208214
"""
209215
df.columns = [sanitize_column_name(x) for x in df.columns]
210216
df.index.names = [None if x is None else sanitize_column_name(x) for x in df.index.names]
211-
if len(set(df.columns)) != len(df.columns): # df.columns.duplicated().any():
217+
if len(set(df.columns)) != len(df.columns):
212218
if handle_duplicate_columns == "warn":
213219
warnings.warn(
214220
"Some columns names are duplicated, consider using `handle_duplicate_columns='[drop|rename]'`",

0 commit comments

Comments
 (0)