Skip to content

Commit

Permalink
Update src/datasets/features/pdf.py
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
  • Loading branch information
yabramuvdi and lhoestq authored Dec 19, 2024
1 parent c85b4f3 commit 944d12e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/datasets/features/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,4 @@ def cast_storage(self, storage: Union[pa.StringArray, pa.StructArray, pa.ListArr
else:
path_array = pa.array([None] * len(storage), type=pa.string())
storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=storage.is_null())
# elif pa.types.is_list(storage.type):
# bytes_array = pa.array(
# [encode_np_array(np.array(arr))["bytes"] if arr is not None else None for arr in storage.to_pylist()],
# type=pa.binary(),
# )
# path_array = pa.array([None] * len(storage), type=pa.string())
# storage = pa.StructArray.from_arrays(
# [bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()
# )
return array_cast(storage, self.pa_type)

0 comments on commit 944d12e

Please sign in to comment.