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

fix: fix ray lance sink error #3230

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
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
31 changes: 31 additions & 0 deletions python/python/lance/ray/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,37 @@ def on_write_complete(
self,
write_results: List[List[Tuple[str, str]]],
):
import warnings

if not write_results:
warnings.warn(
"write_results is empty.",
DeprecationWarning,
)
return
if (
not isinstance(write_results, list)
or not isinstance(write_results[0], list)
) and not hasattr(write_results, "write_returns"):
warnings.warn(
"write_results type is wrong. please check version, "
"upgrade or downgrade your ray version. ray versions >= 2.38 "
"and < 2.41 are unable to write Lance datasets, check ray PR "
"https://github.com/ray-project/ray/pull/49251 in your "
"ray version. ",
DeprecationWarning,
)
return
if hasattr(write_results, "write_returns"):
write_results = write_results.write_returns

if len(write_results) == 0:
warnings.warn(
"write results is empty. please check ray version " "or internal error",
DeprecationWarning,
)
return

fragments = []
schema = None
for batch in write_results:
Expand Down
Loading