Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data] Remove dead code from BinaryDatasource #38234

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into binary-datasource-cleanup2
Signed-off-by: Balaji Veeramani <[email protected]>
  • Loading branch information
bveeramani committed Aug 9, 2023
commit 257b994b6f4011f5c43d52ca4ff9d2dec6a6e0c4
18 changes: 18 additions & 0 deletions python/ray/data/datasource/image_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@ def _read_file(
def _rows_per_file(self):
return 1

def _write_row(
self,
f: "pyarrow.NativeFile",
row,
writer_args_fn: Callable[[], Dict[str, Any]] = lambda: {},
column: str = None,
file_format: str = None,
**writer_args,
):
import io

from PIL import Image

image = Image.fromarray(row[column])
buffer = io.BytesIO()
image.save(buffer, format=file_format)
f.write(buffer.getvalue())


class _ImageFileMetadataProvider(DefaultFileMetadataProvider):
def _set_encoding_ratio(self, encoding_ratio: int):
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.