|
9 | 9 | import urllib.parse
|
10 | 10 | from collections import defaultdict
|
11 | 11 | from datetime import datetime, timezone
|
12 |
| -from typing import Any, List, Dict, Union, Optional, overload, Callable |
13 | 12 | from types import MappingProxyType
|
| 13 | +from typing import Any, Dict, List, Optional, Union, overload |
14 | 14 |
|
15 |
| -from labelbox.schema.search_filters import SearchFilter |
16 | 15 | import requests
|
17 | 16 | import requests.exceptions
|
18 | 17 | from google.api_core import retry
|
|
26 | 25 | from labelbox.orm.model import Entity, Field
|
27 | 26 | from labelbox.pagination import PaginatedCollection
|
28 | 27 | from labelbox.schema import role
|
29 |
| -from labelbox.schema.conflict_resolution_strategy import ( |
30 |
| - ConflictResolutionStrategy, |
31 |
| -) |
32 |
| -from labelbox.schema.data_row import DataRow |
33 | 28 | from labelbox.schema.catalog import Catalog
|
| 29 | +from labelbox.schema.data_row import DataRow |
34 | 30 | from labelbox.schema.data_row_metadata import DataRowMetadataOntology
|
35 | 31 | from labelbox.schema.dataset import Dataset
|
36 | 32 | from labelbox.schema.embedding import Embedding
|
37 | 33 | from labelbox.schema.enums import CollectionJobStatus
|
38 | 34 | from labelbox.schema.foundry.foundry_client import FoundryClient
|
39 | 35 | from labelbox.schema.iam_integration import IAMIntegration
|
40 |
| -from labelbox.schema.identifiables import DataRowIds |
41 |
| -from labelbox.schema.identifiables import GlobalKeys |
| 36 | +from labelbox.schema.identifiables import DataRowIds, GlobalKeys |
| 37 | +from labelbox.schema.label_score import LabelScore |
42 | 38 | from labelbox.schema.labeling_frontend import LabelingFrontend
|
| 39 | +from labelbox.schema.labeling_service_dashboard import LabelingServiceDashboard |
43 | 40 | from labelbox.schema.media_type import (
|
44 | 41 | MediaType,
|
45 | 42 | get_media_type_validation_error,
|
46 | 43 | )
|
47 | 44 | from labelbox.schema.model import Model
|
48 | 45 | from labelbox.schema.model_config import ModelConfig
|
49 | 46 | from labelbox.schema.model_run import ModelRun
|
50 |
| -from labelbox.schema.ontology import Ontology, DeleteFeatureFromOntologyResult |
51 | 47 | from labelbox.schema.ontology import (
|
52 |
| - Tool, |
53 | 48 | Classification,
|
| 49 | + DeleteFeatureFromOntologyResult, |
54 | 50 | FeatureSchema,
|
| 51 | + Ontology, |
55 | 52 | PromptResponseClassification,
|
| 53 | + Tool, |
| 54 | +) |
| 55 | +from labelbox.schema.ontology_kind import ( |
| 56 | + EditorTaskType, |
| 57 | + EditorTaskTypeMapper, |
| 58 | + OntologyKind, |
56 | 59 | )
|
57 | 60 | from labelbox.schema.organization import Organization
|
58 | 61 | from labelbox.schema.project import Project
|
59 | 62 | from labelbox.schema.quality_mode import (
|
60 |
| - QualityMode, |
61 | 63 | BENCHMARK_AUTO_AUDIT_NUMBER_OF_LABELS,
|
62 | 64 | BENCHMARK_AUTO_AUDIT_PERCENTAGE,
|
63 | 65 | CONSENSUS_AUTO_AUDIT_NUMBER_OF_LABELS,
|
64 | 66 | CONSENSUS_AUTO_AUDIT_PERCENTAGE,
|
| 67 | + QualityMode, |
65 | 68 | )
|
66 | 69 | from labelbox.schema.queue_mode import QueueMode
|
67 | 70 | from labelbox.schema.role import Role
|
| 71 | +from labelbox.schema.search_filters import SearchFilter |
68 | 72 | from labelbox.schema.send_to_annotate_params import (
|
69 | 73 | SendToAnnotateFromCatalogParams,
|
| 74 | + build_annotations_input, |
70 | 75 | build_destination_task_queue_input,
|
71 | 76 | build_predictions_input,
|
72 |
| - build_annotations_input, |
73 | 77 | )
|
74 | 78 | from labelbox.schema.slice import CatalogSlice, ModelSlice
|
75 |
| -from labelbox.schema.task import Task, DataUpsertTask |
| 79 | +from labelbox.schema.task import DataUpsertTask, Task |
76 | 80 | from labelbox.schema.user import User
|
77 |
| -from labelbox.schema.label_score import LabelScore |
78 |
| -from labelbox.schema.ontology_kind import ( |
79 |
| - OntologyKind, |
80 |
| - EditorTaskTypeMapper, |
81 |
| - EditorTaskType, |
82 |
| -) |
83 |
| -from labelbox.schema.labeling_service_dashboard import LabelingServiceDashboard |
84 | 81 |
|
85 | 82 | logger = logging.getLogger(__name__)
|
86 | 83 |
|
@@ -540,7 +537,7 @@ def upload_data(
|
540 | 537 | error_msg = next(iter(errors), {}).get(
|
541 | 538 | "message", "Unknown error"
|
542 | 539 | )
|
543 |
| - except Exception as e: |
| 540 | + except Exception: |
544 | 541 | error_msg = "Unknown error"
|
545 | 542 | raise labelbox.exceptions.LabelboxError(
|
546 | 543 | "Failed to upload, message: %s" % error_msg
|
@@ -842,7 +839,7 @@ def create_dataset(
|
842 | 839 |
|
843 | 840 | if not validation_result["validateDataset"]["valid"]:
|
844 | 841 | raise labelbox.exceptions.LabelboxError(
|
845 |
| - f"IAMIntegration was not successfully added to the dataset." |
| 842 | + "IAMIntegration was not successfully added to the dataset." |
846 | 843 | )
|
847 | 844 | except Exception as e:
|
848 | 845 | dataset.delete()
|
|
0 commit comments