File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 2020import json
2121import io
2222import operator
23+ import warnings
2324
2425import google .api_core .retry
2526import pkg_resources
@@ -976,9 +977,17 @@ def test_to_geodataframe(bigquery_client, dataset_id):
976977 assert df ["geog" ][2 ] == wkt .loads ("point(0 0)" )
977978 assert isinstance (df , geopandas .GeoDataFrame )
978979 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+
982991 assert df .crs .srs == "EPSG:4326"
983992 assert df .crs .name == "WGS 84"
984993 assert df .geog .crs .srs == "EPSG:4326"
You can’t perform that action at this time.
0 commit comments