Skip to content

fix: use RuntimeWarning for empty write results in datasink#5193

Open
LuciferYang wants to merge 1 commit into
lance-format:mainfrom
LuciferYang:fix/write-complete-warning-category
Open

fix: use RuntimeWarning for empty write results in datasink#5193
LuciferYang wants to merge 1 commit into
lance-format:mainfrom
LuciferYang:fix/write-complete-warning-category

Conversation

@LuciferYang

Copy link
Copy Markdown

LanceDatasink.on_write_complete warns and skips the commit when it gets no write results back, but it raised that as a DeprecationWarning. Nothing is actually deprecated — it's an empty-input / operational condition — and DeprecationWarning is hidden by default outside __main__, so the warning meant to flag "your write produced nothing to commit" was effectively invisible.

Both empty-result warnings now use RuntimeWarning, which fits the situation and shows up under the default filters. The messages and call sites are otherwise unchanged.

Added unit tests for both branches — the empty list, and the write_returns wrapper unwrapping to empty — each asserting RuntimeWarning and that no DeprecationWarning is raised.

on_write_complete flagged empty write results with DeprecationWarning,
but nothing is deprecated; it is an operational/empty-input condition.
Use RuntimeWarning so it is not filtered by deprecation suppressors.
@github-actions github-actions Bot added the bug Something isn't working label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant