You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2023/02/02 17:59:17 UTC

[sedona] branch master updated: [SEDONA-236] Fix flaky python tests related to converting GeoPandas DataFrames to Spark DataFrames (#753)

This is an automated email from the ASF dual-hosted git repository.

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new 2999d835 [SEDONA-236] Fix flaky python tests related to converting GeoPandas DataFrames to Spark DataFrames (#753)
2999d835 is described below

commit 2999d8353d5cdcb7498526209bab0febf1a2d1d4
Author: Kristin Cowalcijk <mo...@yeah.net>
AuthorDate: Fri Feb 3 01:59:10 2023 +0800

    [SEDONA-236] Fix flaky python tests related to converting GeoPandas DataFrames to Spark DataFrames (#753)
---
 python/tests/serialization/test_deserializers.py | 2 ++
 python/tests/serialization/test_serializers.py   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/python/tests/serialization/test_deserializers.py b/python/tests/serialization/test_deserializers.py
index 215337ba..e6b1e383 100644
--- a/python/tests/serialization/test_deserializers.py
+++ b/python/tests/serialization/test_deserializers.py
@@ -19,6 +19,7 @@ import os
 
 from shapely.geometry import MultiPoint, Point, MultiLineString, LineString, Polygon, MultiPolygon, GeometryCollection
 import geopandas as gpd
+import pandas as pd
 
 from tests import tests_resource
 from tests.test_base import TestBase
@@ -112,6 +113,7 @@ class TestGeometryConvert(TestBase):
 
     def test_from_geopandas_convert(self):
         gdf = gpd.read_file(os.path.join(tests_resource, "shapefiles/gis_osm_pois_free_1/"))
+        gdf = gdf.replace(pd.NA, '')
 
         self.spark.createDataFrame(
             gdf
diff --git a/python/tests/serialization/test_serializers.py b/python/tests/serialization/test_serializers.py
index d5dec9fb..2bc21869 100644
--- a/python/tests/serialization/test_serializers.py
+++ b/python/tests/serialization/test_serializers.py
@@ -19,6 +19,7 @@ import os
 
 from pyspark.sql.types import IntegerType
 import geopandas as gpd
+import pandas as pd
 
 from tests import tests_resource
 from sedona.sql.types import GeometryType
@@ -145,6 +146,7 @@ class TestsSerializers(TestBase):
 
     def test_geopandas_convertion(self):
         gdf = gpd.read_file(os.path.join(tests_resource, "shapefiles/gis_osm_pois_free_1/"))
+        gdf = gdf.replace(pd.NA, '')
         print(self.spark.createDataFrame(
             gdf
         ).toPandas())