Skip to content

Commit

Permalink
handle parquet directories
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-majkel committed Dec 7, 2023
1 parent 9fd728b commit ada58be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions visidata/loaders/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ def iterload(self):
pq = vd.importExternal("pyarrow.parquet", "pyarrow")
from visidata.loaders.arrow import arrow_to_vdtype

with self.source.open('rb') as f:
self.tbl = pq.read_table(f)
if self.source.is_dir():
self.tbl = pq.read_table(str(self.source))
else:
with self.source.open('rb') as f:
self.tbl = pq.read_table(f)

self.columns = []
for colname, col in zip(self.tbl.column_names, self.tbl.columns):
Expand Down

0 comments on commit ada58be

Please # to comment.