uros-db commented on code in PR #52871:
URL: https://github.com/apache/spark/pull/52871#discussion_r2493893374
##########
python/pyspark/sql/types.py:
##########
@@ -2039,6 +2069,148 @@ def parseJson(cls, json_str: str) -> "VariantVal":
return VariantVal(value, metadata)
+class Geography:
+ """
+ A class to represent a Geography value in Python.
+
+ .. versionadded:: 4.1.0
+
+ Parameters
+ ----------
+ wkb : bytes
+ The bytes representing the WKB of Geography.
+
+ srid : integer
+ The integer value representing SRID of Geography.
+
+ Methods
+ -------
+ getBytes()
+ Returns the WKB of Geography.
+
+ getSrid()
+ Returns the SRID of Geography.
+
+ Examples
+ --------
+ >>> from pyspark.sql import functions as sf
+ >>> df =
spark.createDataFrame([(bytes.fromhex("010100000000000000000031400000000000001C40"),)],
["wkb"],) # noqa
+ >>> g = df.select(sf.geogfromwkb(df.wkb).alias("geog")).head().geog #
doctest: +SKIP
Review Comment:
Sounds good, fixed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]