Skip to content

Conversation

@yuqi1129
Copy link

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds namespace support to the TensorFlow integration (lance.tf.data.from_lance), enabling users to specify tables using namespace and table_id instead of direct URIs. This brings the TensorFlow API in line with the core lance.dataset() function's namespace capabilities.

Changes:

  • Added namespace, table_id, and ignore_namespace_table_storage_options parameters to from_lance()
  • Made the dataset parameter optional to support namespace-based table resolution
  • Added validation to prevent mixing LanceDataset instances with namespace/table_id parameters
  • Added comprehensive test coverage for the new functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/python/lance/tf/data.py Added namespace support parameters to from_lance() function, updated documentation, and implemented parameter forwarding to lance.dataset()
python/python/tests/test_tf.py Added test to verify namespace and table_id parameters are correctly forwarded and functional

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +214 to +225
if isinstance(dataset, LanceDataset):
if namespace is not None or table_id is not None:
raise ValueError(
"Cannot specify 'namespace' or 'table_id' when passing a LanceDataset instance"
)
else:
dataset = lance.dataset(
dataset,
namespace=namespace,
table_id=table_id,
ignore_namespace_table_storage_options=ignore_namespace_table_storage_options,
)
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Missing validation to ensure that either dataset or both namespace and table_id are provided. When all three parameters are None, the function will pass None to lance.dataset() which will raise an error, but the error message will mention 'uri' parameter which could be confusing since this function uses 'dataset' as the parameter name. Consider adding explicit validation here with a clear error message that matches the parameter names used in this function.

Copilot uses AI. Check for mistakes.
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.

1 participant