jorisvandenbossche commented on code in PR #44070:
URL: https://github.com/apache/arrow/pull/44070#discussion_r1773282370
##########
python/pyarrow/tests/parquet/test_data_types.py:
##########
@@ -510,3 +510,22 @@ def test_large_binary_overflow():
pa.ArrowInvalid,
match="Parquet cannot store strings with size 2GB or more"):
_write_table(table, writer, use_dictionary=use_dictionary)
+
+
[email protected]("storage_type", (
+ pa.string(), pa.large_string()))
+def test_json_extension_type(storage_type):
+ data = ['{"a": 1}', '{"b": 2}', None]
+ storage = pa.array(data, type=storage_type)
+ json_type = pa.json_(storage_type)
+
+ arr = pa.ExtensionArray.from_storage(json_type, storage)
+ table = pa.table([arr], names=["ext"])
+
+ _simple_table_roundtrip(table)
+
+ for storage_type in (pa.int32(), pa.large_binary(), pa.float32()):
+ with pytest.raises(
+ pa.ArrowInvalid,
+ match="Invalid storage type for JsonExtensionType: " +
str(storage_type)):
+ pa.json_(storage_type)
Review Comment:
Can you move this to the test about the extension type itself? (this is not
related to parquet)
--
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]