Skip to content

Commit a6ee251

Browse files
committed
support sequences in read parquet
1 parent b6412b5 commit a6ee251

File tree

1 file changed

+3
-1
lines changed
  • src/nested_pandas/nestedframe

1 file changed

+3
-1
lines changed

src/nested_pandas/nestedframe/io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# typing.Self and "|" union syntax don't exist in Python 3.9
22
from __future__ import annotations
33

4+
from typing import Sequence
5+
46
import pandas as pd
57
import pyarrow as pa
68
import pyarrow.parquet as pq
@@ -83,7 +85,7 @@ def read_parquet(
8385

8486
# First load through pyarrow
8587
# Check if `data` is a file-like object
86-
if hasattr(data, "read"):
88+
if hasattr(data, "read") or (isinstance(data, Sequence) and not isinstance(data, (str, bytes, bytearray))):
8789
# If `data` is a file-like object, pass it directly to pyarrow
8890
table = pq.read_table(data, columns=columns, **kwargs)
8991
else:

0 commit comments

Comments
 (0)