Skip to content

Commit 5c47042

Browse files
committed
Creating module for routine tests.
1 parent 4265cbd commit 5c47042

File tree

6 files changed

+489
-451
lines changed

6 files changed

+489
-451
lines changed

awswrangler/athena/_read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def read_sql_query(
622622
Should Wrangler delete or keep the staging files produced by Athena?
623623
ctas_temp_table_name : str, optional
624624
The name of the temporary table and also the directory name on S3 where the CTAS result is stored.
625-
If None, it will use the follow random pattern: `f"temp_table_{pyarrow.compat.guid()}"`.
625+
If None, it will use the follow random pattern: `f"temp_table_{uuid.uuid4().hex()}"`.
626626
On S3 this directory will be under under the pattern: `f"{s3_output}/{ctas_temp_table_name}/"`.
627627
use_threads : bool
628628
True to enable concurrent requests, False to disable multiple threads.
@@ -814,7 +814,7 @@ def read_sql_table(
814814
Should Wrangler delete or keep the staging files produced by Athena?
815815
ctas_temp_table_name : str, optional
816816
The name of the temporary table and also the directory name on S3 where the CTAS result is stored.
817-
If None, it will use the follow random pattern: `f"temp_table_{pyarrow.compat.guid()}"`.
817+
If None, it will use the follow random pattern: `f"temp_table_{uuid.uuid4().hex}"`.
818818
On S3 this directory will be under under the pattern: `f"{s3_output}/{ctas_temp_table_name}/"`.
819819
use_threads : bool
820820
True to enable concurrent requests, False to disable multiple threads.

awswrangler/db.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import json
44
import logging
5+
import uuid
56
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
67
from urllib.parse import quote_plus as _quote_plus
78

@@ -754,7 +755,7 @@ def _rs_create_table(
754755
else:
755756
if _rs_does_table_exist(con=con, schema=schema, table=table) is True:
756757
if mode == "upsert":
757-
guid: str = pa.compat.guid()
758+
guid: str = uuid.uuid4().hex
758759
temp_table: str = f"temp_redshift_{guid}"
759760
sql: str = f"CREATE TEMPORARY TABLE {temp_table} (LIKE {schema}.{table})"
760761
_logger.debug(sql)

awswrangler/s3/_read_parquet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def read_parquet(
412412
partition_filter: Optional[Callable[[Dict[str, str]], bool]]
413413
Callback Function filters to apply on PARTITION columns (PUSH-DOWN filter).
414414
This function MUST receive a single argument (Dict[str, str]) where keys are partitions
415-
names and values are partitions values.
415+
names and values are partitions values. Partitions values will be always strings extracted from S3.
416416
This function MUST return a bool, True to read the partition or False to ignore it.
417417
Ignored if `dataset=False`.
418418
E.g ``lambda x: True if x["year"] == "2020" and x["month"] == "1" else False``
@@ -595,7 +595,7 @@ def read_parquet_table(
595595
partition_filter: Optional[Callable[[Dict[str, str]], bool]]
596596
Callback Function filters to apply on PARTITION columns (PUSH-DOWN filter).
597597
This function MUST receive a single argument (Dict[str, str]) where keys are partitions
598-
names and values are partitions values.
598+
names and values are partitions values. Partitions values will be always strings extracted from S3.
599599
This function MUST return a bool, True to read the partition or False to ignore it.
600600
Ignored if `dataset=False`.
601601
E.g ``lambda x: True if x["year"] == "2020" and x["month"] == "1" else False``

awswrangler/s3/_read_text.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def read_csv(
191191
partition_filter: Optional[Callable[[Dict[str, str]], bool]]
192192
Callback Function filters to apply on PARTITION columns (PUSH-DOWN filter).
193193
This function MUST receive a single argument (Dict[str, str]) where keys are partitions
194-
names and values are partitions values.
194+
names and values are partitions values. Partitions values will be always strings extracted from S3.
195195
This function MUST return a bool, True to read the partition or False to ignore it.
196196
Ignored if `dataset=False`.
197197
E.g ``lambda x: True if x["year"] == "2020" and x["month"] == "1" else False``
@@ -319,7 +319,7 @@ def read_fwf(
319319
partition_filter: Optional[Callable[[Dict[str, str]], bool]]
320320
Callback Function filters to apply on PARTITION columns (PUSH-DOWN filter).
321321
This function MUST receive a single argument (Dict[str, str]) where keys are partitions
322-
names and values are partitions values.
322+
names and values are partitions values. Partitions values will be always strings extracted from S3.
323323
This function MUST return a bool, True to read the partition or False to ignore it.
324324
Ignored if `dataset=False`.
325325
E.g ``lambda x: True if x["year"] == "2020" and x["month"] == "1" else False``
@@ -451,7 +451,7 @@ def read_json(
451451
partition_filter: Optional[Callable[[Dict[str, str]], bool]]
452452
Callback Function filters to apply on PARTITION columns (PUSH-DOWN filter).
453453
This function MUST receive a single argument (Dict[str, str]) where keys are partitions
454-
names and values are partitions values.
454+
names and values are partitions values. Partitions values will be always strings extracted from S3.
455455
This function MUST return a bool, True to read the partition or False to ignore it.
456456
Ignored if `dataset=False`.
457457
E.g ``lambda x: True if x["year"] == "2020" and x["month"] == "1" else False``

0 commit comments

Comments
 (0)