Skip to content

feat: add target_bases extension to python write_fragments API#5234

Merged
jackye1995 merged 4 commits intolance-format:mainfrom
jaystarshot:jay-fix-fragments
Nov 18, 2025
Merged

feat: add target_bases extension to python write_fragments API#5234
jackye1995 merged 4 commits intolance-format:mainfrom
jaystarshot:jay-fix-fragments

Conversation

@jaystarshot
Copy link
Copy Markdown
Contributor

@jaystarshot jaystarshot commented Nov 13, 2025

The lance.write_dataset() function already supports writing to multiple storage buckets via the target_bases parameter in #4765

However, write_fragments() did not expose this capability, even though the underlying Rust implementation
_write_fragments, _write_fragments_transaction already supported it

@github-actions github-actions Bot added enhancement New feature or request python labels Nov 13, 2025
Comment thread python/python/lance/fragment.py
@jaystarshot jaystarshot force-pushed the jay-fix-fragments branch 2 times, most recently from b64df0e to be2264c Compare November 15, 2025 01:01
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.

mostly looks good to me, just a nit

Comment thread python/src/transaction.rs Outdated
if let Some(bases_list) = initial_bases_py {
cls.call1((schema_py, fragments_py, bases_list))
} else {
cls.call1((schema_py, fragments_py))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think once you added initial_bases to the Overwrite model, since it's a data class, you won't really be able to invoke this constructor?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

initial_bases in the overwrite has a default value of None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but in that case bases_list will also be None right? so cls.call1((schema_py, fragments_py, bases_list)) should still work?

Copy link
Copy Markdown
Contributor Author

@jaystarshot jaystarshot Nov 18, 2025

Choose a reason for hiding this comment

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

Ahh yes thanks, i explicitly set to only none now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think previously it was a rust none and just need to convert to python none

@jackye1995 jackye1995 merged commit e6abec2 into lance-format:main Nov 18, 2025
12 checks passed
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
…-format#5234)

The lance.write_dataset() function already supports writing to multiple
storage buckets via the target_bases parameter in
lance-format#4765

However, write_fragments() did not expose this capability, even though
the underlying Rust implementation
 _write_fragments, _write_fragments_transaction  already supported it
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.

2 participants