Skip to content

Commit

Permalink
fix ray sink error when there are no data to write
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintBacchus committed Sep 26, 2024
1 parent 51126ab commit 254355e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/python/lance/ray/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ def on_write_complete(
fragment = pickle.loads(fragment_str)
fragments.append(fragment)
schema = pickle.loads(schema_str)
# Check weather writer has fragments or not.
# Skip commit when there are no fragments.
if not schema:
return
if self.mode in set(["create", "overwrite"]):
op = lance.LanceOperation.Overwrite(schema, fragments)
elif self.mode == "append":
Expand Down

0 comments on commit 254355e

Please sign in to comment.