File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1111# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212# See the License for the specific language governing permissions and
1313# limitations under the License.
14+ import math
15+
1416import pytest
1517
1618import bigframes
19+ import bigframes .bigquery
1720from bigframes .testing .utils import assert_pandas_df_equal
1821
1922polars = pytest .importorskip ("polars" )
@@ -63,13 +66,9 @@ def test_polar_execution_unsupported_sql_fallback(
6366 execution_count_before = session_w_polars ._metrics .execution_count
6467 bf_df = session_w_polars .read_pandas (scalars_pandas_df_index )
6568
66- pd_df = scalars_pandas_df_index .copy ()
67- pd_df ["str_len_col" ] = pd_df .string_col .str .len ()
68- pd_result = pd_df
69-
70- bf_df ["str_len_col" ] = bf_df .string_col .str .len ()
69+ bf_df ["geo_area" ] = bigframes .bigquery .st_length (bf_df .geography_col )
7170 bf_result = bf_df .to_pandas ()
7271
73- # str len not supported by polar engine yet, so falls back to bq execution
72+ # geo fns not supported by polar engine yet, so falls back to bq execution
7473 assert session_w_polars ._metrics .execution_count == (execution_count_before + 1 )
75- assert_pandas_df_equal (bf_result , pd_result )
74+ assert math . isclose (bf_result . geo_area . sum (), 70.52332050 , rel_tol = 0.00001 )
You can’t perform that action at this time.
0 commit comments