Skip to content

PyArrow 19.0.0 to_pandas_dataframe error #2

Description

@robinskil
OSError                                   Traceback (most recent call last)
Cell In[5], line 71
     69 # Add the output format
     70 if format == "pandas":
---> 71     df = query_builder.to_pandas_dataframe()
     72 elif format == "geopandas":
     73     gdf = query_builder.to_geo_pandas_dataframe(longitude_column="LONGITUDE", latitude_column="LATITUDE")

File /opt/conda/lib/python3.10/site-packages/beacon_api/query.py:828, in Query.to_pandas_dataframe(self)
    825 response = self.run()
    826 bytes_io = BytesIO(response.content)
--> 828 df = pd.read_parquet(bytes_io)
    829 return df

File /opt/conda/lib/python3.10/site-packages/pandas/io/parquet.py:667, in read_parquet(path, engine, columns, storage_options, use_nullable_dtypes, dtype_backend, filesystem, filters, **kwargs)
    664     use_nullable_dtypes = False
    665 check_dtype_backend(dtype_backend)
--> 667 return impl.read(
    668     path,
    669     columns=columns,
    670     filters=filters,
    671     storage_options=storage_options,
    672     use_nullable_dtypes=use_nullable_dtypes,
    673     dtype_backend=dtype_backend,
    674     filesystem=filesystem,
    675     **kwargs,
    676 )

File /opt/conda/lib/python3.10/site-packages/pandas/io/parquet.py:274, in PyArrowImpl.read(self, path, columns, filters, use_nullable_dtypes, dtype_backend, storage_options, filesystem, **kwargs)
    267 path_or_handle, handles, filesystem = _get_path_or_handle(
    268     path,
    269     filesystem,
    270     storage_options=storage_options,
    271     mode="rb",
    272 )
    273 try:
--> 274     pa_table = self.api.parquet.read_table(
    275         path_or_handle,
    276         columns=columns,
    277         filesystem=filesystem,
    278         filters=filters,
    279         **kwargs,
    280     )
    281     result = pa_table.to_pandas(**to_pandas_kwargs)
    283     if manager == "array":

File /opt/conda/lib/python3.10/site-packages/pyarrow/parquet/core.py:1843, in read_table(source, columns, use_threads, schema, use_pandas_metadata, read_dictionary, memory_map, buffer_size, partitioning, filesystem, filters, use_legacy_dataset, ignore_prefixes, pre_buffer, coerce_int96_timestamp_unit, decryption_properties, thrift_string_size_limit, thrift_container_size_limit, page_checksum_verification)
   1831     # TODO test that source is not a directory or a list
   1832     dataset = ParquetFile(
   1833         source, read_dictionary=read_dictionary,
   1834         memory_map=memory_map, buffer_size=buffer_size,
   (...)
   1840         page_checksum_verification=page_checksum_verification,
   1841     )
-> 1843 return dataset.read(columns=columns, use_threads=use_threads,
   1844                     use_pandas_metadata=use_pandas_metadata)

File /opt/conda/lib/python3.10/site-packages/pyarrow/parquet/core.py:1485, in ParquetDataset.read(self, columns, use_threads, use_pandas_metadata)
   1477         index_columns = [
   1478             col for col in _get_pandas_index_columns(metadata)
   1479             if not isinstance(col, dict)
   1480         ]
   1481         columns = (
   1482             list(columns) + list(set(index_columns) - set(columns))
   1483         )
-> 1485 table = self._dataset.to_table(
   1486     columns=columns, filter=self._filter_expression,
   1487     use_threads=use_threads
   1488 )
   1490 # if use_pandas_metadata, restore the pandas metadata (which gets
   1491 # lost if doing a specific `columns` selection in to_table)
   1492 if use_pandas_metadata:

File /opt/conda/lib/python3.10/site-packages/pyarrow/_dataset.pyx:574, in pyarrow._dataset.Dataset.to_table()

File /opt/conda/lib/python3.10/site-packages/pyarrow/_dataset.pyx:3865, in pyarrow._dataset.Scanner.to_table()

File /opt/conda/lib/python3.10/site-packages/pyarrow/error.pxi:155, in pyarrow.lib.pyarrow_internal_check_status()

File /opt/conda/lib/python3.10/site-packages/pyarrow/error.pxi:92, in pyarrow.lib.check_status()

OSError: Repetition level histogram size mismatch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions