Skip to content

Commit 03082d8

Browse files
authored
Remove unsupported Lance dataset option (#1)
CI fails against pylance 8.0.0 because `lance.dataset` no longer accepts `ignore_namespace_table_storage_options`. This removes that argument from the TensorFlow adapter API and keeps namespace table lookup on the supported `namespace_client` and `table_id` arguments. Local validation: - `uv run ruff format --check .` - `uv run ruff check .` - `uv run pytest -q` (TensorFlow tests skipped locally because TensorFlow is not installed on this macOS environment)
1 parent 6aa5318 commit 03082d8

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

src/lance_tensorflow/data.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def from_lance(
156156
output_signature: Optional[Dict[str, tf.TypeSpec]] = None,
157157
namespace_client: Optional["LanceNamespace"] = None,
158158
table_id: Optional[List[str]] = None,
159-
ignore_namespace_table_storage_options: bool = False,
160159
) -> tf.data.Dataset:
161160
"""Create a ``tf.data.Dataset`` from a Lance dataset.
162161
@@ -184,9 +183,6 @@ def from_lance(
184183
table_id : Optional[List[str]], optional
185184
Table identifier used together with ``namespace_client`` to locate
186185
the table.
187-
ignore_namespace_table_storage_options : bool, default False
188-
When using ``namespace_client``/``table_id``, ignore storage options
189-
returned by the namespace.
190186
191187
Examples
192188
--------
@@ -237,7 +233,6 @@ def from_lance(
237233
dataset,
238234
namespace_client=namespace_client,
239235
table_id=table_id,
240-
ignore_namespace_table_storage_options=ignore_namespace_table_storage_options,
241236
)
242237

243238
if isinstance(fragments, tf.data.Dataset):

tests/test_data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,17 @@ def fake_dataset(uri=None, **kwargs):
119119
None,
120120
namespace_client=ns,
121121
table_id=["tbl"],
122-
ignore_namespace_table_storage_options=True,
123122
)
124123

125124
assert calls["kwargs"]["namespace_client"] is ns
126125
assert calls["kwargs"]["table_id"] == ["tbl"]
127-
assert calls["kwargs"]["ignore_namespace_table_storage_options"] is True
128126

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

132130

133131
def test_scan_use_tf_data(tf_dataset):
134-
ds = tf.data.Dataset.from_lance(tf_dataset)
132+
ds = tf.data.Dataset.from_lance(tf_dataset, batch_size=100)
135133
for idx, batch in enumerate(ds):
136134
assert batch["a"].numpy()[0] == idx * 100
137135
assert batch["s"].numpy()[0] == f"val-{idx * 100}".encode("utf-8")

0 commit comments

Comments
 (0)