|
1 |
| -from datetime import datetime |
2 |
| -from typing import Dict, Generator, List, Optional, Any, Final, Tuple, Union |
3 |
| -import os |
4 | 1 | import json
|
5 | 2 | import logging
|
6 |
| -from collections.abc import Iterable |
7 |
| -from string import Template |
8 |
| -import time |
| 3 | +import os |
9 | 4 | import warnings
|
10 |
| - |
11 |
| -from labelbox import parser |
12 |
| -from itertools import islice |
13 |
| - |
14 | 5 | from concurrent.futures import ThreadPoolExecutor, as_completed
|
15 |
| -from io import StringIO |
16 |
| -import requests |
| 6 | +from itertools import islice |
| 7 | +from string import Template |
| 8 | +from typing import Any, Dict, List, Optional, Tuple, Union |
17 | 9 |
|
| 10 | +import labelbox.schema.internal.data_row_uploader as data_row_uploader |
18 | 11 | from labelbox.exceptions import (
|
19 | 12 | InvalidQueryError,
|
20 | 13 | LabelboxError,
|
21 |
| - ResourceNotFoundError, |
22 | 14 | ResourceCreationError,
|
| 15 | + ResourceNotFoundError, |
23 | 16 | )
|
| 17 | +from labelbox.orm import query |
24 | 18 | from labelbox.orm.comparison import Comparison
|
25 |
| -from labelbox.orm.db_object import DbObject, Updateable, Deletable, experimental |
| 19 | +from labelbox.orm.db_object import DbObject, Deletable, Updateable |
26 | 20 | from labelbox.orm.model import Entity, Field, Relationship
|
27 |
| -from labelbox.orm import query |
28 |
| -from labelbox.exceptions import MalformedQueryException |
29 | 21 | from labelbox.pagination import PaginatedCollection
|
30 | 22 | from labelbox.schema.data_row import DataRow
|
31 |
| -from labelbox.schema.embedding import EmbeddingVector |
32 | 23 | from labelbox.schema.export_filters import DatasetExportFilters, build_filters
|
33 | 24 | from labelbox.schema.export_params import (
|
34 | 25 | CatalogExportParams,
|
35 | 26 | validate_catalog_export_params,
|
36 | 27 | )
|
37 | 28 | from labelbox.schema.export_task import ExportTask
|
38 |
| -from labelbox.schema.identifiable import UniqueId, GlobalKey |
39 |
| -from labelbox.schema.task import Task, DataUpsertTask |
40 |
| -from labelbox.schema.user import User |
41 | 29 | from labelbox.schema.iam_integration import IAMIntegration
|
| 30 | +from labelbox.schema.identifiable import GlobalKey, UniqueId |
42 | 31 | from labelbox.schema.internal.data_row_upsert_item import (
|
| 32 | + DataRowCreateItem, |
43 | 33 | DataRowItemBase,
|
44 | 34 | DataRowUpsertItem,
|
45 |
| - DataRowCreateItem, |
46 |
| -) |
47 |
| -import labelbox.schema.internal.data_row_uploader as data_row_uploader |
48 |
| -from labelbox.schema.internal.descriptor_file_creator import ( |
49 |
| - DescriptorFileCreator, |
50 | 35 | )
|
51 | 36 | from labelbox.schema.internal.datarow_upload_constants import (
|
52 | 37 | FILE_UPLOAD_THREAD_COUNT,
|
53 | 38 | UPSERT_CHUNK_SIZE_BYTES,
|
54 | 39 | )
|
| 40 | +from labelbox.schema.task import DataUpsertTask, Task |
55 | 41 |
|
56 | 42 | logger = logging.getLogger(__name__)
|
57 | 43 |
|
@@ -359,7 +345,7 @@ def data_row_for_external_id(self, external_id) -> "DataRow":
|
359 | 345 | )
|
360 | 346 | if len(data_rows) > 1:
|
361 | 347 | logger.warning(
|
362 |
| - f"More than one data_row has the provided external_id : `%s`. Use function data_rows_for_external_id to fetch all", |
| 348 | + "More than one data_row has the provided external_id : `%s`. Use function data_rows_for_external_id to fetch all", |
363 | 349 | external_id,
|
364 | 350 | )
|
365 | 351 | return data_rows[0]
|
|
0 commit comments