rdblue commented on code in PR #5462:
URL: https://github.com/apache/iceberg/pull/5462#discussion_r952957521


##########
python/tests/test_transforms.py:
##########
@@ -318,3 +420,31 @@ def test_void_transform_str():
 
 def test_void_transform_repr():
     assert repr(VoidTransform()) == "VoidTransform()"
+
+
[email protected](
+    "transform,json",
+    [
+        (YearTransform(), '"year"'),
+        (MonthTransform(), '"month"'),
+        (DayTransform(), '"day"'),
+        (HourTransform(), '"hour"'),
+    ],
+)
+def test_datetime_transform_serde(transform, json):
+    assert transform.json() == json
+    assert TestType.parse_raw(json).__root__ == transform
+
+
[email protected](

Review Comment:
   @jun-he, when in doubt, do not parameterize. If you need to do anything 
special whatsoever, like updating an assert to use `__root__` instead of 
`isinstance(..., YearTransform)` then parameters are not a good idea.



-- 
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]

Reply via email to