File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 20
20
import json
21
21
import io
22
22
import operator
23
+ import warnings
23
24
24
25
import google .api_core .retry
25
26
import pkg_resources
@@ -976,9 +977,17 @@ def test_to_geodataframe(bigquery_client, dataset_id):
976
977
assert df ["geog" ][2 ] == wkt .loads ("point(0 0)" )
977
978
assert isinstance (df , geopandas .GeoDataFrame )
978
979
assert isinstance (df ["geog" ], geopandas .GeoSeries )
979
- assert df .area [0 ] == 0.5
980
- assert pandas .isna (df .area [1 ])
981
- assert df .area [2 ] == 0.0
980
+
981
+ with warnings .catch_warnings ():
982
+ # Computing the area on a GeoDataFrame that uses a geographic Coordinate
983
+ # Reference System (CRS) produces a warning that we are not interested in.
984
+ # We do not mind if the computed area is incorrect with respect to the
985
+ # GeoDataFrame data, as long as it matches the expected "incorrect" value.
986
+ warnings .filterwarnings ("ignore" , category = UserWarning )
987
+ assert df .area [0 ] == 0.5
988
+ assert pandas .isna (df .area [1 ])
989
+ assert df .area [2 ] == 0.0
990
+
982
991
assert df .crs .srs == "EPSG:4326"
983
992
assert df .crs .name == "WGS 84"
984
993
assert df .geog .crs .srs == "EPSG:4326"
You can’t perform that action at this time.
0 commit comments