Skip to content

Commit

Permalink
fix: fix ray lance sink error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay-ju committed Dec 30, 2024
1 parent c237bcb commit a152077
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/python/lance/ray/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,27 @@ 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 "Empty list"
if (
not isinstance(write_results, list)
or not isinstance(write_results[0], list)
) and hasattr(write_results, "write_returns"):
warnings.warn(
"write_results type is wrong. please check version",
DeprecationWarning,
)
return "Empty list"

if hasattr(write_results, "write_returns"):
write_results = write_results.write_returns

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

0 comments on commit a152077

Please sign in to comment.