File tree Expand file tree Collapse file tree
cratedb_toolkit/io/mongodb Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from attrs import define , field
1818from boltons .urlutils import URL
1919from bson .raw_bson import RawBSONDocument
20- from undatum . common . iterable import IterableData
20+ from iterable . helpers . detect import open_iterable
2121
2222from cratedb_toolkit .io .mongodb .model import DocumentDict
2323from 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 )
Original file line number Diff line number Diff line change @@ -220,12 +220,12 @@ optional-dependencies.mcp = [
220220optional-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]
230230optional-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 ]
Original file line number Diff line number Diff line change 1414pytest .importorskip ("bsonjs" , reason = "Skipping tests because bsonjs is not installed" )
1515pytest .importorskip ("pymongo" , reason = "Skipping tests because pymongo is not installed" )
1616pytest .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.
You can’t perform that action at this time.
0 commit comments