Skip to content

Commit 6f48c9e

Browse files
NO-SNOW: Fix pandas type test (#2600)
1 parent 4fa0773 commit 6f48c9e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/snowflake/connector/pandas_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def write_pandas(
408408
):
409409
warnings.warn(
410410
"Dataframe contains a datetime with timezone column, but "
411-
f"'{use_logical_type=}'. This can result in dateimes "
411+
f"'{use_logical_type=}'. This can result in datetimes "
412412
"being incorrectly written to Snowflake. Consider setting "
413413
"'use_logical_type = True'",
414414
UserWarning,

test/integ/pandas_it/test_pandas_tools.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,15 +972,21 @@ def test_all_pandas_types(
972972
with conn_cnx() as cnx:
973973
try:
974974
success, nchunks, nrows, _ = write_pandas(
975-
cnx, df, table_name, quote_identifiers=True, auto_create_table=True
975+
cnx,
976+
df,
977+
table_name,
978+
quote_identifiers=True,
979+
auto_create_table=True,
980+
use_logical_type=True,
976981
)
977982

978983
# Check write_pandas output
979984
assert success
980985
assert nrows == len(df_data)
981986
assert nchunks == 1
982987
# Check table's contents
983-
result = cnx.cursor(DictCursor).execute(select_sql).fetchall()
988+
cur = cnx.cursor(DictCursor).execute(select_sql)
989+
result = cur.fetchall()
984990
for row, data in zip(result, df_data):
985991
for c in columns:
986992
# TODO: check values of timestamp data after SNOW-667350 is fixed

0 commit comments

Comments
 (0)