HyukjinKwon commented on code in PR #45826:
URL: https://github.com/apache/spark/pull/45826#discussion_r1548761997
##########
python/pyspark/sql/types.py:
##########
@@ -1468,6 +1475,36 @@ def __eq__(self, other: Any) -> bool:
return type(self) == type(other)
+class VariantVal:
+ """
+ A class to represent a Variant value in Python.
+ """
+
+ def __init__(self, value: bytes, metadata: bytes):
+ self.value = value
+ self.metadata = metadata
+
+ def __str__(self) -> str:
+ return self.toString()
+
+ def __repr__(self) -> str:
+ return "VariantVal(%s, %s)" % (self.value, self.metadata)
+
+ def toString(self) -> str:
+ """
+ Convert the VariantVal to a string.
+ :return: a string representation of the Variant
Review Comment:
Let's follow numpydoc style.
--
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]