Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/lance_tensorflow/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def from_lance(
output_signature: Optional[Dict[str, tf.TypeSpec]] = None,
namespace_client: Optional["LanceNamespace"] = None,
table_id: Optional[List[str]] = None,
ignore_namespace_table_storage_options: bool = False,
) -> tf.data.Dataset:
"""Create a ``tf.data.Dataset`` from a Lance dataset.

Expand Down Expand Up @@ -184,9 +183,6 @@ def from_lance(
table_id : Optional[List[str]], optional
Table identifier used together with ``namespace_client`` to locate
the table.
ignore_namespace_table_storage_options : bool, default False
When using ``namespace_client``/``table_id``, ignore storage options
returned by the namespace.

Examples
--------
Expand Down Expand Up @@ -237,7 +233,6 @@ def from_lance(
dataset,
namespace_client=namespace_client,
table_id=table_id,
ignore_namespace_table_storage_options=ignore_namespace_table_storage_options,
)

if isinstance(fragments, tf.data.Dataset):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,17 @@ def fake_dataset(uri=None, **kwargs):
None,
namespace_client=ns,
table_id=["tbl"],
ignore_namespace_table_storage_options=True,
)

assert calls["kwargs"]["namespace_client"] is ns
assert calls["kwargs"]["table_id"] == ["tbl"]
assert calls["kwargs"]["ignore_namespace_table_storage_options"] is True

batches = list(ds)
assert [b["a"].numpy().tolist() for b in batches] == [[1, 2]]


def test_scan_use_tf_data(tf_dataset):
ds = tf.data.Dataset.from_lance(tf_dataset)
ds = tf.data.Dataset.from_lance(tf_dataset, batch_size=100)
for idx, batch in enumerate(ds):
assert batch["a"].numpy()[0] == idx * 100
assert batch["s"].numpy()[0] == f"val-{idx * 100}".encode("utf-8")
Expand Down
Loading