1717import bigframes .bigquery as bbq
1818import bigframes .dtypes as dtypes
1919import bigframes .pandas as bpd
20- import bigframes .testing
20+ import bigframes .testing . utils
2121
2222
2323def test_sql_scalar_for_all_scalar_types (scalars_df_null_index ):
@@ -60,7 +60,9 @@ def test_sql_scalar_for_bool_series(scalars_df_index):
6060 result = bbq .sql_scalar ("CAST({0} AS INT64)" , [series ])
6161 expected = series .astype (dtypes .INT_DTYPE )
6262 expected .name = result .name
63- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
63+ bigframes .testing .utils .assert_series_equal (
64+ result .to_pandas (), expected .to_pandas ()
65+ )
6466
6567
6668@pytest .mark .parametrize (
@@ -84,7 +86,9 @@ def test_sql_scalar_outputs_all_scalar_types(scalars_df_index, column_name):
8486 result = bbq .sql_scalar ("{0}" , [series ])
8587 expected = series
8688 expected .name = result .name
87- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
89+ bigframes .testing .utils .assert_series_equal (
90+ result .to_pandas (), expected .to_pandas ()
91+ )
8892
8993
9094def test_sql_scalar_for_array_series (repeated_df ):
@@ -114,14 +118,18 @@ def test_sql_scalar_for_array_series(repeated_df):
114118 + repeated_df ["numeric_list_col" ].list .len ()
115119 + repeated_df ["string_list_col" ].list .len ()
116120 )
117- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
121+ bigframes .testing .utils .assert_series_equal (
122+ result .to_pandas (), expected .to_pandas ()
123+ )
118124
119125
120126def test_sql_scalar_outputs_array_series (repeated_df ):
121127 result = bbq .sql_scalar ("{0}" , [repeated_df ["int_list_col" ]])
122128 expected = repeated_df ["int_list_col" ]
123129 expected .name = result .name
124- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
130+ bigframes .testing .utils .assert_series_equal (
131+ result .to_pandas (), expected .to_pandas ()
132+ )
125133
126134
127135def test_sql_scalar_for_struct_series (nested_structs_df ):
@@ -132,14 +140,18 @@ def test_sql_scalar_for_struct_series(nested_structs_df):
132140 expected = nested_structs_df ["person" ].struct .field (
133141 "name"
134142 ).str .len () + nested_structs_df ["person" ].struct .field ("age" )
135- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
143+ bigframes .testing .utils .assert_series_equal (
144+ result .to_pandas (), expected .to_pandas ()
145+ )
136146
137147
138148def test_sql_scalar_outputs_struct_series (nested_structs_df ):
139149 result = bbq .sql_scalar ("{0}" , [nested_structs_df ["person" ]])
140150 expected = nested_structs_df ["person" ]
141151 expected .name = result .name
142- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
152+ bigframes .testing .utils .assert_series_equal (
153+ result .to_pandas (), expected .to_pandas ()
154+ )
143155
144156
145157def test_sql_scalar_for_json_series (json_df ):
@@ -151,11 +163,15 @@ def test_sql_scalar_for_json_series(json_df):
151163 )
152164 expected = bbq .json_value (json_df ["json_col" ], "$.int_value" )
153165 expected .name = result .name
154- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
166+ bigframes .testing .utils .assert_series_equal (
167+ result .to_pandas (), expected .to_pandas ()
168+ )
155169
156170
157171def test_sql_scalar_outputs_json_series (json_df ):
158172 result = bbq .sql_scalar ("{0}" , [json_df ["json_col" ]])
159173 expected = json_df ["json_col" ]
160174 expected .name = result .name
161- bigframes .testing .assert_series_equal (result .to_pandas (), expected .to_pandas ())
175+ bigframes .testing .utils .assert_series_equal (
176+ result .to_pandas (), expected .to_pandas ()
177+ )
0 commit comments