Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
The following currently fail due to Shapely not liking nulls/Nones:
def test_null_deserializer(self): result = self.spark.sql("select st_geomfromwkt(null)").collect()[0][0] assert result is None def test_null_serializer(self): data = [ [1, None] ] schema = t.StructType( [ t.StructField("id", IntegerType(), True), t.StructField("geom", GeometryType(), True), ] ) self.spark.createDataFrame( data, schema ).createOrReplaceTempView("points") count = self.spark.sql("select count from points").collect()[0][0] assert count == 1
The solution is to add some null guards to methods in the python GeometryType class. I can make a PR for this but I wasn't sure if I needed to wait for this issue to be approved or acknowledged or something
Edit: I adjusted the deserializer test. I accidentally used a previous version that fails on analysis. This version fails when the None is attempted to be iterated in Python.
Attachments
Issue Links
- links to