james-willis commented on code in PR #1229:
URL: https://github.com/apache/sedona-db/pull/1229#discussion_r3928095648


##########
python/sedonadb/python/sedonadb/expr/literal.py:
##########
@@ -191,15 +199,137 @@ def _lit_from_shapely(obj):
     return _lit_from_wkb_and_crs(obj.wkb, None)
 
 
-def _lit_from_wkb_and_crs(wkb, crs):
+def _lit_from_wkb_and_crs(wkb, crs, edge_type=None):
     import geoarrow.pyarrow as ga
     import pyarrow as pa
 
     type = ga.wkb().with_crs(crs)
+    if edge_type is not None:
+        type = type.with_edge_type(edge_type)
     storage = pa.array([wkb], type.storage_type)
     return type.wrap_array(storage)
 
 
+def _lit_from_missing(obj):
+    # pandas.NA and numpy.ma.masked both mean "no value".
+    import pyarrow as pa
+
+    return pa.array([None])
+
+
+def _lit_from_nat(obj):
+    # NaT is a datetime missing value in pandas (assigning it yields a
+    # datetime64 column), so it resolves to a typed timestamp null rather
+    # than an untyped NULL.
+    import pyarrow as pa
+
+    return pa.array([None], pa.timestamp("ns"))

Review Comment:
   how do we know it should be ns? I supposed it doesn't matter since the 
system can cast it to other TS types as needed in the query?



##########
python/sedonadb/python/sedonadb/expr/literal.py:
##########
@@ -191,15 +199,137 @@ def _lit_from_shapely(obj):
     return _lit_from_wkb_and_crs(obj.wkb, None)
 
 
-def _lit_from_wkb_and_crs(wkb, crs):
+def _lit_from_wkb_and_crs(wkb, crs, edge_type=None):

Review Comment:
   function name probably needs an update



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to