@@ -136,6 +136,9 @@ def get_df_from_reader_and_file_format(reader, file_format):
136
136
137
137
@pytest .fixture (scope = "module" , autouse = True )
138
138
def setup (session , resources_path , local_testing_mode ):
139
+ # TODO SNOW-2098847: remove this workaround after fixing the issue
140
+ session ._use_scoped_temp_objects = False
141
+
139
142
test_files = TestFiles (resources_path )
140
143
if not local_testing_mode :
141
144
Utils .create_stage (session , tmp_stage_name1 , is_temporary = True )
@@ -1971,10 +1974,6 @@ def test_read_multiple_csvs(session):
1971
1974
"config.getoption('local_testing_mode', default=False)" ,
1972
1975
reason = "xml not supported in local testing mode" ,
1973
1976
)
1974
- @pytest .mark .skipif (
1975
- IS_IN_STORED_PROC ,
1976
- reason = "SNOW-2044853: Flaky in stored procedure test" ,
1977
- )
1978
1977
@pytest .mark .parametrize (
1979
1978
"file,row_tag,expected_row_count,expected_column_count" ,
1980
1979
[
@@ -1997,10 +1996,6 @@ def test_read_xml_row_tag(
1997
1996
"config.getoption('local_testing_mode', default=False)" ,
1998
1997
reason = "xml not supported in local testing mode" ,
1999
1998
)
2000
- @pytest .mark .skipif (
2001
- IS_IN_STORED_PROC ,
2002
- reason = "SNOW-2044853: Flaky in stored procedure test" ,
2003
- )
2004
1999
def test_read_xml_no_xxe (session ):
2005
2000
row_tag = "bar"
2006
2001
stage_file_path = f"@{ tmp_stage_name1 } /{ test_file_xxe_xml } "
@@ -2012,10 +2007,6 @@ def test_read_xml_no_xxe(session):
2012
2007
"config.getoption('local_testing_mode', default=False)" ,
2013
2008
reason = "xml not supported in local testing mode" ,
2014
2009
)
2015
- @pytest .mark .skipif (
2016
- IS_IN_STORED_PROC ,
2017
- reason = "SNOW-2044853: Flaky in stored procedure test" ,
2018
- )
2019
2010
def test_read_xml_query_nested_data (session ):
2020
2011
row_tag = "tag"
2021
2012
df = session .read .option ("rowTag" , row_tag ).xml (
@@ -2046,10 +2037,6 @@ def test_read_xml_non_existing_file(session):
2046
2037
"config.getoption('local_testing_mode', default=False)" ,
2047
2038
reason = "xml not supported in local testing mode" ,
2048
2039
)
2049
- @pytest .mark .skipif (
2050
- IS_IN_STORED_PROC ,
2051
- reason = "SNOW-2044853: Flaky in stored procedure test" ,
2052
- )
2053
2040
@pytest .mark .parametrize (
2054
2041
"file" ,
2055
2042
(
@@ -2060,12 +2047,13 @@ def test_read_xml_non_existing_file(session):
2060
2047
)
2061
2048
def test_read_malformed_xml (session , file ):
2062
2049
row_tag = "record"
2050
+ file_path = f"@{ tmp_stage_name1 } /{ file } "
2063
2051
2064
2052
# permissive mode
2065
2053
df = (
2066
2054
session .read .option ("rowTag" , row_tag )
2067
2055
.option ("mode" , "permissive" )
2068
- .xml (f"@ { tmp_stage_name1 } / { file } " )
2056
+ .xml (file_path )
2069
2057
)
2070
2058
result = df .collect ()
2071
2059
assert len (result ) == 2
@@ -2079,17 +2067,15 @@ def test_read_malformed_xml(session, file):
2079
2067
df = (
2080
2068
session .read .option ("rowTag" , row_tag )
2081
2069
.option ("mode" , "dropmalformed" )
2082
- .xml (f"@ { tmp_stage_name1 } / { test_file_malformed_no_closing_tag_xml } " )
2070
+ .xml (file_path )
2083
2071
)
2084
2072
result = df .collect ()
2085
2073
assert len (result ) == 1
2086
2074
assert len (result [0 ]) == 3
2087
2075
2088
2076
# failfast mode
2089
2077
df = (
2090
- session .read .option ("rowTag" , row_tag )
2091
- .option ("mode" , "failfast" )
2092
- .xml (f"@{ tmp_stage_name1 } /{ test_file_malformed_no_closing_tag_xml } " )
2078
+ session .read .option ("rowTag" , row_tag ).option ("mode" , "failfast" ).xml (file_path )
2093
2079
)
2094
2080
with pytest .raises (SnowparkSQLException , match = "Malformed XML record at bytes" ):
2095
2081
df .collect ()
0 commit comments