Skip to content

Commit 273ccd0

Browse files
NO-SNOW: fix flaky tests (#4061)
1 parent 9e16b0e commit 273ccd0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/snowflake/snowpark/dataframe.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class DataFrame:
385385
>>> with tempfile.NamedTemporaryFile(mode="w+t") as t:
386386
... t.writelines(["id1, Product A", "\\n" "id2, Product B"])
387387
... t.flush()
388-
... create_stage_result = session.sql("create temp stage test_stage").collect()
388+
... create_stage_result = session.sql("create or replace temp stage test_stage").collect()
389389
... put_result = session.file.put(t.name, "@test_stage/test_dir")
390390
391391
Example 1
@@ -418,7 +418,7 @@ class DataFrame:
418418
|2 |two |
419419
---------------------
420420
<BLANKLINE>
421-
>>> session.range(1, 10, 2).to_df("col1").show()
421+
>>> session.range(1, 10, 2).to_df("col1").sort("col1").show()
422422
----------
423423
|"COL1" |
424424
----------
@@ -4641,7 +4641,7 @@ def write(self) -> DataFrameWriter:
46414641
|3 |4 |
46424642
-------------
46434643
<BLANKLINE>
4644-
>>> stage_created_result = session.sql("create temp stage if not exists test_stage").collect()
4644+
>>> stage_created_result = session.sql("create or replace temp stage test_stage").collect()
46454645
>>> df.write.copy_into_location("@test_stage/copied_from_dataframe") # default CSV
46464646
[Row(rows_unloaded=2, input_bytes=8, output_bytes=28)]
46474647
"""
@@ -4689,7 +4689,7 @@ def copy_into_table(
46894689
>>> with tempfile.NamedTemporaryFile(mode="w+t") as t:
46904690
... t.writelines(["id1, Product A", "\\n" "id2, Product B"])
46914691
... t.flush()
4692-
... create_stage_result = session.sql("create temp stage if not exists test_stage").collect()
4692+
... create_stage_result = session.sql("create or replace temp stage test_stage").collect()
46934693
... put_result = session.file.put(t.name, "@test_stage/copy_into_table_dir", overwrite=True)
46944694
>>> # user_schema is used to read from CSV files. For other files it's not needed.
46954695
>>> from snowflake.snowpark.types import StringType, StructField, StringType

src/snowflake/snowpark/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2856,7 +2856,7 @@ def generator(
28562856
Example 1
28572857
>>> from snowflake.snowpark.functions import seq1, seq8, uniform
28582858
>>> df = session.generator(seq1(1).as_("sequence one"), uniform(1, 10, 2).as_("uniform"), rowcount=3)
2859-
>>> df.show()
2859+
>>> df.sort("sequence one").show()
28602860
------------------------------
28612861
|"sequence one" |"UNIFORM" |
28622862
------------------------------

tests/integ/modin/index/test_reindex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_non_overlapping_different_types_index_negative_SNOW_1622502():
170170

171171
with pytest.raises(
172172
SnowparkSQLException,
173-
match='Failed to cast variant value "A" to TIMESTAMP_NTZ',
173+
match='Failed to cast variant value "[ABC]" to TIMESTAMP_NTZ',
174174
):
175175
date_index.reindex(list("ABC"))
176176

0 commit comments

Comments
 (0)