Skip to content

Commit 28787ad

Browse files
authored
Merge pull request #411 from superannotateai/friday
Fixed streamed data chinks handeling
2 parents 7adb6dc + 8c75a04 commit 28787ad

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/superannotate/lib/infrastructure/controller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ def __init__(self, config_path: str = None, token: str = None):
7474
self.initialize_backend_client()
7575

7676
def retrieve_configs(self, path: Path, raise_exception=True):
77+
7778
token, backend_url, ssl_verify = None, None, None
78-
if not path.is_file() or not os.access(path, os.R_OK):
79+
if not Path(path).is_file() or not os.access(path, os.R_OK):
7980
if raise_exception:
8081
raise AppException(
8182
f"SuperAnnotate config file {str(path)} not found."

tests/integration/test_df_processing.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def folder_path(self):
1919
)
2020

2121
def test_filter_instances(self):
22-
df = sa.aggregate_annotations_as_df(self.folder_path,self.PROJECT_TYPE)
22+
df = sa.aggregate_annotations_as_df(self.folder_path, self.PROJECT_TYPE)
2323
df = df[~(df.duplicated(["instanceId", "imageName"]))]
2424
df = df[df.duplicated(["trackingId"], False) & df["trackingId"].notnull()]
2525
self.assertEqual(len(df), 2)
@@ -28,6 +28,7 @@ def test_filter_instances(self):
2828
{"example_image_1.jpg", "example_image_2.jpg"},
2929
)
3030

31+
3132
class TestDFWithTagInstace(BaseTestCase):
3233
PROJECT_TYPE = "Vector"
3334
TEST_FOLDER_PATH = "data_set/sample_project_vector_with_tag"
@@ -38,13 +39,11 @@ def folder_path(self):
3839
Path(os.path.join(dirname(dirname(__file__)), self.TEST_FOLDER_PATH))
3940
)
4041

41-
4242
def test_filter_instances(self):
4343
df = sa.aggregate_annotations_as_df(self.folder_path, self.PROJECT_TYPE)
4444
self.assertEqual(df.iloc[0]["type"], "tag")
4545

4646

47-
4847
class TestClassDistibutionWithTagInstance(BaseTestCase):
4948
PROJECT_TYPE = "Vector"
5049
EXPORT_ROOT_PATH = "data_set"
@@ -57,6 +56,6 @@ def root_path(self):
5756
)
5857

5958
def test_filter_instances(self):
60-
df = sa.class_distribution(export_root=self.root_path,project_names=[self.PROJECT_NAME])
59+
df = sa.class_distribution(export_root=self.root_path, project_names=[self.PROJECT_NAME])
6160
self.assertEqual(df.iloc[0]['count'], 1)
62-
self.assertEqual(df.iloc[0]['className'], "Weather")
61+
self.assertEqual(df.iloc[0]['className'], "Weather")

0 commit comments

Comments
 (0)