Skip to content

Commit abf7f6b

Browse files
committed
fix bug
1 parent d19346e commit abf7f6b

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
@@ -2509,12 +2509,6 @@ def __init__(
25092509
self._project = project
25102510
self._return_metadata = return_metadata
25112511

2512-
def validate_project_type(self):
2513-
if self._project.project_type in constances.LIMITED_FUNCTIONS:
2514-
raise AppValidationException(
2515-
constances.LIMITED_FUNCTIONS[self._project.project_type]
2516-
)
2517-
25182512
def execute(self):
25192513
if self.is_valid():
25202514
data = self._service.get_exports(
@@ -4003,7 +3997,7 @@ def execute(self):
40033997
return self._response
40043998

40053999

4006-
class DownloadExportUseCase(BaseUseCase):
4000+
class DownloadExportUseCase(BaseInteractiveUseCase):
40074001
def __init__(
40084002
self,
40094003
service: SuerannotateServiceProvider,
@@ -4092,20 +4086,24 @@ def get_upload_files_count(self):
40924086

40934087
def execute(self):
40944088
if self.is_valid():
4089+
report = []
40954090
if self._to_s3_bucket:
40964091
self.get_upload_files_count()
40974092
yield from self.upload_to_s3_from_folder(self._temp_dir.name)
4098-
logger.info(f"Exported to AWS {self._to_s3_bucket}/{self._folder_path}")
4093+
report.append(
4094+
f"Exported to AWS {self._to_s3_bucket}/{self._folder_path}"
4095+
)
40994096
self._temp_dir.cleanup()
41004097
else:
41014098
export_id, filepath, destination = self.download_to_local_storage(
41024099
self._folder_path
41034100
)
41044101
if self._extract_zip_contents:
4105-
logger.info(f"Extracted {filepath} to folder {destination}")
4102+
report.append(f"Extracted {filepath} to folder {destination}")
41064103
else:
4107-
logger.info(f"Downloaded export ID {export_id} to {filepath}")
4104+
report.append(f"Downloaded export ID {export_id} to {filepath}")
41084105
yield
4106+
self._response.data = "\n".join(report)
41094107
return self._response
41104108

41114109

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)