Skip to content

Commit 6daeb5c

Browse files
authored
Merge pull request #212 from superannotateai/328_315
fix bug
2 parents 18a0748 + abf7f6b commit 6daeb5c

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pillow>=7.2.0
77
numpy>=1.19.0
88
matplotlib>=3.3.1
99
xmltodict==0.12.0
10-
opencv-python==4.4.0.42
10+
opencv-python>=4.4.0.42
1111
wheel==0.35.1
1212
packaging>=20.4
1313
pandas>=1.1.4

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,10 +2173,12 @@ def download_export(
21732173
total=use_case.get_upload_files_count(), desc="Uploading"
21742174
) as progress_bar:
21752175
for _ in use_case.execute():
2176-
progress_bar.update(1)
2176+
progress_bar.update()
2177+
progress_bar.close()
21772178
else:
21782179
for _ in use_case.execute():
21792180
continue
2181+
logger.info(use_case.response.data)
21802182

21812183

21822184
@Trackable

src/superannotate/lib/core/usecases.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,12 +2508,6 @@ def __init__(
25082508
self._project = project
25092509
self._return_metadata = return_metadata
25102510

2511-
def validate_project_type(self):
2512-
if self._project.project_type in constances.LIMITED_FUNCTIONS:
2513-
raise AppValidationException(
2514-
constances.LIMITED_FUNCTIONS[self._project.project_type]
2515-
)
2516-
25172511
def execute(self):
25182512
if self.is_valid():
25192513
data = self._service.get_exports(
@@ -3999,7 +3993,7 @@ def execute(self):
39993993
return self._response
40003994

40013995

4002-
class DownloadExportUseCase(BaseUseCase):
3996+
class DownloadExportUseCase(BaseInteractiveUseCase):
40033997
def __init__(
40043998
self,
40053999
service: SuerannotateServiceProvider,
@@ -4090,20 +4084,24 @@ def get_upload_files_count(self):
40904084

40914085
def execute(self):
40924086
if self.is_valid():
4087+
report = []
40934088
if self._to_s3_bucket:
40944089
self.get_upload_files_count()
40954090
yield from self.upload_to_s3_from_folder(self._temp_dir.name)
4096-
logger.info(f"Exported to AWS {self._to_s3_bucket}/{self._folder_path}")
4091+
report.append(
4092+
f"Exported to AWS {self._to_s3_bucket}/{self._folder_path}"
4093+
)
40974094
self._temp_dir.cleanup()
40984095
else:
40994096
export_id, filepath, destination = self.download_to_local_storage(
41004097
self._folder_path
41014098
)
41024099
if self._extract_zip_contents:
4103-
logger.info(f"Extracted {filepath} to folder {destination}")
4100+
report.append(f"Extracted {filepath} to folder {destination}")
41044101
else:
4105-
logger.info(f"Downloaded export ID {export_id} to {filepath}")
4102+
report.append(f"Downloaded export ID {export_id} to {filepath}")
41064103
yield
4104+
self._response.data = "\n".join(report)
41074105
return self._response
41084106

41094107

tests/integration/test_attach_video_urls.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ def test_attach_video_urls_without_name_column(self):
3737
self.assertEqual(len(uploaded), 7)
3838
self.assertEqual(len(could_not_upload), 0)
3939
self.assertEqual(len(existing_images), 1)
40+
41+
def test_get_exports(self):
42+
sa.attach_video_urls_to_project(
43+
self.PROJECT_NAME,
44+
self.csv_path_without_name_column
45+
)
46+
sa.prepare_export(self.PROJECT_NAME)
47+
self.assertEqual(len(sa.get_exports(self.PROJECT_NAME)),1)

0 commit comments

Comments
 (0)