Skip to content

Commit d0c8614

Browse files
committed
Improve redshift tests.
1 parent bcef16f commit d0c8614

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

testing/test_awswrangler/test_db.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
get_df,
1818
get_df_category,
1919
get_time_str_with_random_suffix,
20-
path_generator
20+
path_generator,
2121
)
2222

2323
logging.basicConfig(level=logging.INFO, format="[%(asctime)s][%(levelname)s][%(name)s][%(funcName)s] %(message)s")
@@ -549,21 +549,17 @@ def test_null(parameters, db_type):
549549

550550

551551
def test_redshift_spectrum_long_string(path, glue_table, glue_database, external_schema):
552-
df = pd.DataFrame({
553-
"id": [1, 2],
554-
"col_str": [
555-
''.join(random.choice(string.ascii_letters) for _ in range(300)),
556-
''.join(random.choice(string.ascii_letters) for _ in range(300))
557-
]
558-
})
552+
df = pd.DataFrame(
553+
{
554+
"id": [1, 2],
555+
"col_str": [
556+
"".join(random.choice(string.ascii_letters) for _ in range(300)),
557+
"".join(random.choice(string.ascii_letters) for _ in range(300)),
558+
],
559+
}
560+
)
559561
paths = wr.s3.to_parquet(
560-
df=df,
561-
path=path,
562-
database=glue_database,
563-
table=glue_table,
564-
mode="overwrite",
565-
index=False,
566-
dataset=True,
562+
df=df, path=path, database=glue_database, table=glue_table, mode="overwrite", index=False, dataset=True
567563
)["paths"]
568564
wr.s3.wait_objects_exist(paths=paths, use_threads=False)
569565
engine = wr.catalog.get_engine(connection="aws-data-wrangler-redshift")
@@ -576,13 +572,15 @@ def test_redshift_spectrum_long_string(path, glue_table, glue_database, external
576572

577573

578574
def test_redshift_copy_unload_long_string(path, parameters):
579-
df = pd.DataFrame({
580-
"id": [1, 2],
581-
"col_str": [
582-
''.join(random.choice(string.ascii_letters) for _ in range(300)),
583-
''.join(random.choice(string.ascii_letters) for _ in range(300))
584-
]
585-
})
575+
df = pd.DataFrame(
576+
{
577+
"id": [1, 2],
578+
"col_str": [
579+
"".join(random.choice(string.ascii_letters) for _ in range(300)),
580+
"".join(random.choice(string.ascii_letters) for _ in range(300)),
581+
],
582+
}
583+
)
586584
engine = wr.catalog.get_engine(connection="aws-data-wrangler-redshift")
587585
wr.db.copy_to_redshift(
588586
df=df,

0 commit comments

Comments
 (0)