Skip to content

feat: support fragment level update columns operation in Python#5001

Merged
jackye1995 merged 3 commits intolance-format:mainfrom
xloya:support-fragment-update-columns-in-python
Oct 28, 2025
Merged

feat: support fragment level update columns operation in Python#5001
jackye1995 merged 3 commits intolance-format:mainfrom
xloya:support-fragment-update-columns-in-python

Conversation

@xloya
Copy link
Copy Markdown
Contributor

@xloya xloya commented Oct 20, 2025

Close #5000. Refer to the implementation in the Java SDK.

@github-actions github-actions Bot added enhancement New feature or request python labels Oct 20, 2025
@xloya xloya force-pushed the support-fragment-update-columns-in-python branch from 24ebe1f to 4349db8 Compare October 20, 2025 03:44
fields_modified: List[int]
fields_for_preserving_frag_bitmap: List[int]
update_mode: str
removed_fragment_ids: List[int] = dataclasses.field(default_factory=list)
Copy link
Copy Markdown
Contributor Author

@xloya xloya Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's necessary to assign initial values ​​to the attributes in the Update Operation. Otherwise, when using the following commit code:

op = LanceOperation.Update(
    updated_fragments=[updated_fragment],
    fields_modified=fields_modified,
)
updated_dataset = lance.LanceDataset.commit(
    str(dataset_uri), op, read_version=dataset.version
)

It will encounter the following exception:

TypeError: LanceOperation.Update.__init__() missing 4 required positional arguments: 'removed_fragment_ids', 'new_fragments', 'fields_for_preserving_frag_bitmap', and 'update_mode'

@xloya xloya force-pushed the support-fragment-update-columns-in-python branch 3 times, most recently from 46e21fb to 577437a Compare October 20, 2025 05:05
Comment thread python/python/tests/test_fragment.py
@xloya xloya force-pushed the support-fragment-update-columns-in-python branch from 577437a to 721a8c0 Compare October 20, 2025 06:37
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.75%. Comparing base (affff28) to head (4fb5fbc).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5001      +/-   ##
==========================================
+ Coverage   81.71%   81.75%   +0.03%     
==========================================
  Files         340      340              
  Lines      137236   137555     +319     
  Branches   137236   137555     +319     
==========================================
+ Hits       112144   112454     +310     
+ Misses      21371    21369       -2     
- Partials     3721     3732      +11     
Flag Coverage Δ
unittests 81.75% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xloya xloya force-pushed the support-fragment-update-columns-in-python branch from c1f7317 to 4fb5fbc Compare October 22, 2025 01:49
@xloya
Copy link
Copy Markdown
Contributor Author

xloya commented Oct 22, 2025

@wayneli-vt @jackye1995 @westonpace @wjones127 PTAL, thx!

@wayneli-vt
Copy link
Copy Markdown
Contributor

@xloya Looks good to me! Thank you for the Python implementation, and especially for adding such comprehensive unit tests!

Copy link
Copy Markdown
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@jackye1995 jackye1995 merged commit 3cec378 into lance-format:main Oct 28, 2025
14 checks passed
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
…e-format#5001)

Close lance-format#5000. Refer to the implementation in the Java SDK.

---------

Co-authored-by: xloya <xiaojiebao@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support fragment level update columns in Python SDK

4 participants