Skip to content

Commit 9b6d979

Browse files
committed
fix mixpanel
1 parent 959d723 commit 9b6d979

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/superannotate/lib/app/mixp/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import sys
33
from inspect import signature
44

5-
from lib import get_default_controller
65
from mixpanel import Mixpanel
6+
7+
from lib import get_default_controller
78
from superannotate.logger import get_default_logger
89
from version import __version__
9-
1010
from .utils import parsers
1111

1212
logger = get_default_logger()

src/superannotate/lib/app/mixp/utils/parsers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,8 @@ def assign_images(*args, **kwargs):
873873

874874
contributors = (
875875
Controller.get_default()
876-
.get_project_metadata(project_name=project, include_contributors=True)
877-
.data["contributors"]
876+
.get_project_metadata(project_name=project, include_contributors=True)
877+
.data["contributors"]
878878
)
879879
contributor = None
880880
for c in contributors:
@@ -1229,15 +1229,15 @@ def get_integrations(*args, **kwargs):
12291229
}
12301230

12311231

1232-
def attach_items_from_integrated_storage(*args, **kwargs):
1233-
project = kwargs.get("project", args[0])
1234-
integration = kwargs.get("integration", args[1])
1235-
folder_path = kwargs.get("folder_path", args[2])
1232+
def attach_items_from_integrated_storage(**kwargs):
1233+
project = kwargs.get("project")
1234+
integration = kwargs.get("integration")
1235+
folder_path = kwargs.get("folder_path")
12361236

12371237
project_name, _ = extract_project_folder(project)
12381238
if isinstance(integration, str):
12391239
integration = IntegrationEntity(name=integration)
1240-
project = Controller.get_default().get_project_metadata(project_name)
1240+
project = Controller.get_default().get_project_metadata(project_name).data["project"]
12411241
return {
12421242
"event_name": "attach_items_from_integrated_storage",
12431243
"properties": {

tests/integration/classes/test_create_annotation_class.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def test_create_annotations_classes_from_class_json(self):
2727
classes = sa.create_annotation_classes_from_classes_json(self.PROJECT_NAME, self.large_json_path)
2828
self.assertEqual(len(classes), 1500)
2929

30+
def test_hex_color_adding(self):
31+
sa.create_annotation_class(self.PROJECT_NAME, "test_add", color="#0000FF")
32+
classes = sa.search_annotation_classes(self.PROJECT_NAME, "test_add")
33+
assert classes[0]["color"] == "#0000FF"
34+
3035

3136
class TestCreateAnnotationClassNonVectorWithError(BaseTestCase):
3237
PROJECT_NAME = "TestCreateAnnotationClassNonVectorWithError"

0 commit comments

Comments
 (0)