Skip to content

Commit

Permalink
Fix deprecation warning of using '.data' attribute of ChunkedArray (#703
Browse files Browse the repository at this point in the history
)
  • Loading branch information
selitvin authored Jul 26, 2021
1 parent b597360 commit 20e46e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions petastorm/arrow_reader_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def read_next(self, workers_pool, schema, ngram):

# `to_pandas` works slower when called on the entire `data` rather directly on a chunk.
if result_table.column(0).num_chunks == 1:
column_as_pandas = column.data.chunks[0].to_pandas()
column_as_pandas = column.chunks[0].to_pandas()
else:
column_as_pandas = column.data.to_pandas()
column_as_pandas = column.to_pandas()

# pyarrow < 0.15.0 would always return a numpy array. Starting 0.15 we get pandas series, hence we
# convert it into numpy array
Expand Down

0 comments on commit 20e46e0

Please sign in to comment.