Skip to content

Commit 5732e4c

Browse files
committed
update tests
1 parent 1dcf82f commit 5732e4c

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

tests/integ/test_catalog.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ def test_list_tables(session, temp_db1, temp_schema1, temp_table1, temp_table2):
241241
assert cols[0].datatype == "NUMBER(38,0)"
242242
assert cols[0].nullable is True
243243
assert cols[1].name == "B"
244-
assert cols[1].datatype == "VARCHAR(16777216)"
244+
# 2025_07/bcr-2118 changes the default string length from 16777216 to 134217728
245+
assert (
246+
cols[1].datatype == "VARCHAR(16777216)"
247+
or cols[1].datatype == "VARCHAR(134217728)"
248+
)
245249
assert cols[1].nullable is True
246250

247251

tests/integ/test_dataframe.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7117,7 +7117,16 @@ def test_create_dataframe_implicit_struct_not_null_mixed(session):
71177117
StructField("TXT", StringType(2**24), nullable=False),
71187118
]
71197119

7120-
assert df.schema.fields == expected_fields
7120+
expected_fields_with_2025_07_BCR = [
7121+
StructField("FLAG", BooleanType(), nullable=False),
7122+
StructField("DT", df.schema.fields[1].datatype, nullable=True),
7123+
StructField("TXT", StringType(2**27), nullable=False),
7124+
]
7125+
7126+
assert (
7127+
df.schema.fields == expected_fields
7128+
or df.schema.fields == expected_fields_with_2025_07_BCR
7129+
)
71217130

71227131
# Verify rows
71237132
result = df.collect()

tests/integ/test_pandas_to_df.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -672,19 +672,23 @@ def test_create_from_pandas_basic_pandas_types(session):
672672
# blocks us from using it.
673673
if is_in_stored_procedure():
674674
max_size = "134217728"
675-
assert (
676-
str(sp_df.schema)
677-
== f"""\
675+
676+
# 2025_07 BCR bundle changes the default max string size to 128MB in preprod, but prod is not changed yet.
677+
allowed_schema = [
678+
f"""\
678679
StructType([\
679-
StructField('"sTr"', StringType({max_size}), nullable=True), \
680+
StructField('"sTr"', StringType({allowed_holder}), nullable=True), \
680681
StructField('"dOublE"', DoubleType(), nullable=True), \
681682
StructField('"LoNg"', LongType(), nullable=True), \
682683
StructField('"booL"', BooleanType(), nullable=True), \
683684
StructField('"timestamp"', TimestampType(timezone=TimestampTimeZone('ntz')), nullable=True), \
684685
StructField('TIMEDELTA', LongType(), nullable=True)\
685686
])\
686687
"""
687-
)
688+
for allowed_holder in ["", max_size]
689+
]
690+
691+
assert str(sp_df.schema) in allowed_schema
688692
assert sp_df.select('"sTr"').collect() == [Row("Name1"), Row("nAme_2")]
689693
assert sp_df.select('"dOublE"').collect() == [Row(1.2), Row(20)]
690694
assert sp_df.select('"LoNg"').collect() == [Row(1234567890), Row(1)]

0 commit comments

Comments
 (0)