@@ -225,14 +225,14 @@ def to_parquet( # pylint: disable=too-many-arguments,too-many-locals
225225) -> Dict [str , Union [List [str ], Dict [str , List [str ]]]]:
226226 """Write Parquet file or dataset on Amazon S3.
227227
228- The concept of Dataset goes beyond the simple idea of files and enable more
229- complex features like partitioning, casting and catalog integration (Amazon Athena/AWS Glue Catalog).
228+ The concept of Dataset goes beyond the simple idea of ordinary files and enable more
229+ complex features like partitioning and catalog integration (Amazon Athena/AWS Glue Catalog).
230230
231231 Note
232232 ----
233- If `dataset=True` The table name and all column names will be automatically sanitized using
234- `wr.catalog.sanitize_table_name` and `wr.catalog.sanitize_column_name`.
235- Please, pass `sanitize_columns=True` to force the same behaviour for `dataset=False` .
233+ If `database` and ` table` arguments are passed, the table name and all column names
234+ will be automatically sanitized using `wr.catalog.sanitize_table_name` and `wr.catalog.sanitize_column_name`.
235+ Please, pass `sanitize_columns=True` to enforce this behaviour always .
236236
237237 Note
238238 ----
@@ -267,12 +267,15 @@ def to_parquet( # pylint: disable=too-many-arguments,too-many-locals
267267 "SSECustomerAlgorithm", "SSECustomerKey", "SSEKMSKeyId", "SSEKMSEncryptionContext", "Tagging".
268268 e.g. s3_additional_kwargs={'ServerSideEncryption': 'aws:kms', 'SSEKMSKeyId': 'YOUR_KMY_KEY_ARN'}
269269 sanitize_columns : bool
270- True to sanitize columns names or False to keep it as is.
271- True value is forced if `dataset=True`.
270+ True to sanitize columns names (using `wr.catalog.sanitize_table_name` and `wr.catalog.sanitize_column_name`)
271+ or False to keep it as is.
272+ True value behaviour is enforced if `database` and `table` arguments are passed.
272273 dataset : bool
273- If True store a parquet dataset instead of a single file.
274+ If True store a parquet dataset instead of a ordinary file(s)
274275 If True, enable all follow arguments:
275- partition_cols, mode, database, table, description, parameters, columns_comments, .
276+ partition_cols, mode, database, table, description, parameters, columns_comments, concurrent_partitioning,
277+ catalog_versioning, projection_enabled, projection_types, projection_ranges, projection_values,
278+ projection_intervals, projection_digits, catalog_id, schema_evolution.
276279 partition_cols: List[str], optional
277280 List of column names that will be used to create partitions. Only takes effect if dataset=True.
278281 concurrent_partitioning: bool
@@ -470,7 +473,7 @@ def to_parquet( # pylint: disable=too-many-arguments,too-many-locals
470473 session : boto3 .Session = _utils .ensure_session (session = boto3_session )
471474
472475 # Sanitize table to respect Athena's standards
473- if (sanitize_columns is True ) or (dataset is True ):
476+ if (sanitize_columns is True ) or (database is not None and table is not None ):
474477 df , dtype , partition_cols = _sanitize (df = df , dtype = dtype , partition_cols = partition_cols )
475478
476479 # Evaluating dtype
0 commit comments