Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions python/pyarrow/parquet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class ParquetFile:
it will be parsed as an URI to determine the filesystem.
page_checksum_verification : bool, default False
If True, verify the checksum for each page read from the file.
arrow_extensions_enabled : bool, default False
arrow_extensions_enabled : bool, default True
If True, read Parquet logical types as Arrow extension types where possible,
(e.g., read JSON as the canonical `arrow.json` extension type or UUID as
the canonical `arrow.uuid` extension type).
Expand Down Expand Up @@ -314,7 +314,7 @@ def __init__(self, source, *, metadata=None, common_metadata=None,
coerce_int96_timestamp_unit=None,
decryption_properties=None, thrift_string_size_limit=None,
thrift_container_size_limit=None, filesystem=None,
page_checksum_verification=False, arrow_extensions_enabled=False):
page_checksum_verification=False, arrow_extensions_enabled=True):

self._close_source = getattr(source, 'closed', True)

Expand Down Expand Up @@ -1321,7 +1321,7 @@ class ParquetDataset:
sufficient for most Parquet files.
page_checksum_verification : bool, default False
If True, verify the page checksum for each page read from the file.
arrow_extensions_enabled : bool, default False
arrow_extensions_enabled : bool, default True
If True, read Parquet logical types as Arrow extension types where possible,
(e.g., read JSON as the canonical `arrow.json` extension type or UUID as
the canonical `arrow.uuid` extension type).
Expand All @@ -1339,7 +1339,7 @@ def __init__(self, path_or_paths, filesystem=None, schema=None, *, filters=None,
decryption_properties=None, thrift_string_size_limit=None,
thrift_container_size_limit=None,
page_checksum_verification=False,
arrow_extensions_enabled=False):
arrow_extensions_enabled=True):
import pyarrow.dataset as ds

# map format arguments
Expand Down Expand Up @@ -1739,7 +1739,7 @@ def partitioning(self):
sufficient for most Parquet files.
page_checksum_verification : bool, default False
If True, verify the checksum for each page read from the file.
arrow_extensions_enabled : bool, default False
arrow_extensions_enabled : bool, default True
If True, read Parquet logical types as Arrow extension types where possible,
(e.g., read JSON as the canonical `arrow.json` extension type or UUID as
the canonical `arrow.uuid` extension type).
Expand Down Expand Up @@ -1839,7 +1839,7 @@ def read_table(source, *, columns=None, use_threads=True,
decryption_properties=None, thrift_string_size_limit=None,
thrift_container_size_limit=None,
page_checksum_verification=False,
arrow_extensions_enabled=False):
arrow_extensions_enabled=True):

try:
dataset = ParquetDataset(
Expand Down
7 changes: 5 additions & 2 deletions python/pyarrow/tests/parquet/test_data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,15 @@ def test_json_extension_type(storage_type):
_check_roundtrip(
table,
pa.table({"ext": pa.array(data, pa.string())}),
{"arrow_extensions_enabled": False},
store_schema=False)

# With arrow_extensions_enabled=True on read, we get a arrow.json back
# (but with string() storage)
_check_roundtrip(
table,
pa.table({"ext": pa.array(data, pa.json_(pa.string()))}),
read_table_kwargs={"arrow_extensions_enabled": True},
{"arrow_extensions_enabled": True},
store_schema=False)


Expand All @@ -594,11 +595,13 @@ def test_uuid_extension_type():
_check_roundtrip(
table,
pa.table({"ext": pa.array(data, pa.binary(16))}),
{"arrow_extensions_enabled": False},
store_schema=False)
_check_roundtrip(
table,
table,
{"arrow_extensions_enabled": True}, store_schema=False)
{"arrow_extensions_enabled": True},
store_schema=False)


def test_undefined_logical_type(parquet_test_datadir):
Expand Down
Loading