fix: restore CreateEmptyTable deprecated shims for backwards compatibility#333
Open
LuciferYang wants to merge 1 commit intolance-format:mainfrom
Open
Conversation
…ility v0.7.0 removed CreateEmptyTableRequest/CreateEmptyTableResponse and the create_empty_table() method, breaking all previously-released pylance wheels (e.g. 2.0.1, 4.0.0b1) that import these symbols. Restore them as deprecated aliases pointing to CreateTableRequest/ CreateTableResponse, and restore the create_empty_table() method with a DeprecationWarning directing users to declare_table() instead. This matches the deprecation approach already used in v0.6.1 and gives downstreams a migration window before final removal. Closes lance-format#331
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore
CreateEmptyTableRequest/CreateEmptyTableResponseas deprecated aliases and restore thecreate_empty_table()method with aDeprecationWarning, to unbreak previously-released pylance wheels.Problem
v0.7.0 (#330) removed these symbols entirely. Released pylance wheels (
2.0.1,4.0.0b1, etc.) do:With
lance-namespace>=0.7.0installed,import lancefails withImportError.Downstream workarounds:
pyproject.tomlupper bound pinFix
Three minimal changes to
python/lance_namespace/lance_namespace/__init__.py:CreateEmptyTableRequest = CreateTableRequest/CreateEmptyTableResponse = CreateTableResponsewith a comment explaining they will be removed in a future release__all__updated — re-export both symbolscreate_empty_table()method restored — withDeprecationWarningdirecting users todeclare_table()insteadThis matches the deprecation approach already used in v0.6.1 and gives downstreams a migration window before final removal.
Test plan
from lance_namespace import CreateEmptyTableRequest, CreateEmptyTableResponsesucceedspip install pylance==2.0.1) canimport lancewithout errorCloses #331