Skip to content

Commit 9e8ebbd

Browse files
committed
I/O: Migrate from undatum to iterabledata
1 parent e2eb473 commit 9e8ebbd

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

cratedb_toolkit/io/mongodb/adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from attrs import define, field
1818
from boltons.urlutils import URL
1919
from bson.raw_bson import RawBSONDocument
20-
from undatum.common.iterable import IterableData
20+
from iterable.helpers.detect import open_iterable
2121

2222
from cratedb_toolkit.io.mongodb.model import DocumentDict
2323
from cratedb_toolkit.io.mongodb.util import batches
@@ -138,7 +138,7 @@ def query(self):
138138
if self._path.suffix in [".json", ".jsonl", ".ndjson"]:
139139
data = read_json(str(self._path))
140140
elif ".bson" in str(self._path):
141-
data = IterableData(str(self._path), options={"format_in": "bson"}).iter()
141+
data = open_iterable(str(self._path))
142142
else:
143143
raise ValueError(f"Unsupported file type: {self._path.suffix}")
144144
return batches(data, self.batch_size)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ optional-dependencies.mcp = [
220220
optional-dependencies.mongodb = [
221221
"commons-codec[mongodb]>=0.0.22",
222222
"cratedb-toolkit[io,io-recipe]",
223+
"iterabledata<2",
223224
"orjson>=3.3.1,<4",
224225
"pymongo>=3.10.1,<4.17",
225226
"pyorc<0.11; python_version<'3.10'",
226227
"python-bsonjs<0.8",
227228
"rich>=3.3.2,<16",
228-
"undatum<1.2",
229229
]
230230
optional-dependencies.nlsql = [
231231
"llama-index-llms-anthropic<0.12; python_version>='3.10'",
@@ -369,6 +369,7 @@ analysis.allowed-unresolved-imports = [
369369
"importlib_metadata.**",
370370
"importlib_resources.**",
371371
"ingestr.**",
372+
"iterable.**",
372373
"jessiql.**",
373374
"kaggle.**",
374375
"kinesis.**",
@@ -378,7 +379,6 @@ analysis.allowed-unresolved-imports = [
378379
"pymongo.**",
379380
"sqlalchemy.**",
380381
"tikray.**",
381-
"undatum.**",
382382
]
383383

384384
[tool.pytest]

tests/io/mongodb/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
pytest.importorskip("bsonjs", reason="Skipping tests because bsonjs is not installed")
1515
pytest.importorskip("pymongo", reason="Skipping tests because pymongo is not installed")
1616
pytest.importorskip("rich", reason="Skipping tests because rich is not installed")
17-
pytest.importorskip("undatum", reason="Skipping tests because undatum is not installed")
17+
pytest.importorskip("iterable", reason="Skipping tests because iterabledata is not installed")
1818

1919

2020
# Define databases to be deleted before running each test case.

0 commit comments

Comments
 (0)