18
18
from archive_query_log .cli .util import pass_config
19
19
from archive_query_log .config import Config
20
20
from archive_query_log .legacy .model import ArchivedUrl
21
+ from archive_query_log .legacy .urls .iterable import ArchivedUrls
21
22
from archive_query_log .namespaces import NAMESPACE_CAPTURE
22
23
from archive_query_log .orm import Source , Capture , Archive , Provider , \
23
24
InnerProvider , InnerArchive
@@ -240,9 +241,6 @@ def _import_aql22_path(
240
241
importable_path : _Aql22ImportablePath ,
241
242
check_memento : bool = True ,
242
243
) -> None :
243
- from archive_query_log .legacy .model import ArchivedUrl
244
- from archive_query_log .legacy .urls .iterable import ArchivedUrls
245
-
246
244
echo (f"Importing captures from { importable_path .path } to "
247
245
f"archive { importable_path .archive .id } and "
248
246
f"provider { importable_path .provider .id } ." )
@@ -276,7 +274,7 @@ def _import_aql22_path(
276
274
desc = "Importing captures" ,
277
275
unit = "capture" ,
278
276
)
279
- captures = _iter_aql22_captures (
277
+ captures_iter = _iter_aql22_captures (
280
278
config = config ,
281
279
importable_path = importable_path ,
282
280
last_modified = oldest_modification_time ,
@@ -288,7 +286,7 @@ def _import_aql22_path(
288
286
** capture .to_dict (include_meta = True ),
289
287
"_op_type" : "create" ,
290
288
}
291
- for capture in captures
289
+ for capture in captures_iter
292
290
)
293
291
try :
294
292
responses : Iterable [tuple [bool , Any ]] = config .es .streaming_bulk (
0 commit comments