Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to download export results #9075

Merged
merged 57 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2a2dc86
Add new API && remove deprecated && refactor working with rq meta
Marishka17 Feb 7, 2025
e3d6da9
Remove outdated tests
Marishka17 Feb 7, 2025
a01a8a8
Resolve conflicts
Marishka17 Feb 7, 2025
0f71c08
Rename method
Marishka17 Feb 7, 2025
a22e10f
Split RQMeta into several classes && small fixes
Marishka17 Feb 9, 2025
19a322a
Black code
Marishka17 Feb 9, 2025
f535d32
f
Marishka17 Feb 9, 2025
3c9895b
Fix typo
Marishka17 Feb 9, 2025
a896dfd
Resolve conflicts
Marishka17 Feb 14, 2025
5aceaf4
Fix merge
Marishka17 Feb 14, 2025
f05f591
Resolve conflicts
Marishka17 Feb 25, 2025
1ea77dc
Fix missing import
Marishka17 Feb 25, 2025
24d1c87
Store result filename in RQ meta
Marishka17 Feb 25, 2025
f503d49
Fix func signature
Marishka17 Feb 27, 2025
69b1f9f
Update permissions
Marishka17 Feb 27, 2025
b909919
Fix typos
Marishka17 Feb 27, 2025
347251f
Do not disable request card after downloading file
Marishka17 Feb 27, 2025
0c1e928
Update tests
Marishka17 Feb 27, 2025
2688ae4
Fix typos
Marishka17 Feb 27, 2025
5f52083
Revert back checking dataset import status by old API
Marishka17 Feb 27, 2025
af4ad59
Add redis migration
Marishka17 Feb 27, 2025
9bfe8b6
Remove unused imports
Marishka17 Feb 27, 2025
b8f35f8
Drop unrelated chnages
Marishka17 Feb 28, 2025
5e2569b
Update server schema
Marishka17 Feb 28, 2025
27f7ad9
Use result_url && result_filename in meta
Marishka17 Feb 28, 2025
e48743c
Try to fix cypress tests
Marishka17 Feb 28, 2025
7f0406b
[unit tests] Update test_rest_api_3D.py
Marishka17 Feb 28, 2025
32cd6dd
typos
Marishka17 Feb 28, 2025
9ea13d1
Update engine.tests.test_rest_api.TaskImportExportAPITestCase
Marishka17 Mar 3, 2025
b0e80d7
Update remaining unit tests
Marishka17 Mar 3, 2025
3c06e58
Reduce code duplication in tests
Marishka17 Mar 3, 2025
8177944
Fix ExportBehaviorTest::test_concurrent_download_and_cleanup
Marishka17 Mar 3, 2025
41d56b3
Remove csrf workaround
Marishka17 Mar 3, 2025
acbbfae
Black tests
Marishka17 Mar 3, 2025
c228c1f
Disable pylint warning
Marishka17 Mar 3, 2025
dec3676
Remove unused imports
Marishka17 Mar 3, 2025
662a529
cleanup the code
Marishka17 Mar 3, 2025
5ab096b
Merge branch 'develop' into mk/api_to_download_export_results
Marishka17 Mar 3, 2025
703d871
unused import
Marishka17 Mar 3, 2025
9e3f831
typos
Marishka17 Mar 3, 2025
4198bef
Add chnagelog fragment
Marishka17 Mar 4, 2025
ea498ae
Update changelog
Marishka17 Mar 7, 2025
d1ee24b
Apply comments
Marishka17 Mar 11, 2025
c42385b
Fix typo and pylint issue
Marishka17 Mar 11, 2025
3946e6f
Fix server schema
Marishka17 Mar 11, 2025
22c4783
Small fixes in server schema
Marishka17 Mar 11, 2025
397939c
Reduce code duplication in tests && small fixes
Marishka17 Mar 11, 2025
d14d047
Merge branch 'develop' into mk/api_to_download_export_results
Marishka17 Mar 11, 2025
8222969
Fix unit tests
Marishka17 Mar 12, 2025
d321c01
Cleanup code
Marishka17 Mar 12, 2025
4dee705
Fix redis migration
Marishka17 Mar 12, 2025
4b01053
Refactor redis migration a bit
Marishka17 Mar 12, 2025
13507c2
Remove outdated comment
Marishka17 Mar 12, 2025
1ad1f80
Remove <> from response
Marishka17 Mar 13, 2025
54558fc
Update description of deprecated query params
Marishka17 Mar 13, 2025
570b60f
Do not wait requests to be finished in tests
Marishka17 Mar 13, 2025
10cd428
Merge branch 'develop' into mk/api_to_download_export_results
Marishka17 Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Deprecated

- Utilizing `GET /api/projects/id/dataset?action=import_status` API endpoint
to check the status of the import process. Instead, the `GET /api/requests/rq_id`
requests API should be used (<https://github.com/cvat-ai/cvat/pull/9075>)

### Removed

- `GET /api/projects/id/dataset` API endpoint no longer handles dataset export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/projects/id/annotations` API endpoint no longer handles annotations export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/projects/id/backup` API endpoint no longer handles project export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/tasks/id/dataset` API endpoint no longer handles dataset export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/tasks/id/annotations?format=` API endpoint no longer handles annotations export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/tasks/id/backup` API endpoint no longer handles task export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/jobs/id/dataset` API endpoint no longer handles dataset export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
- `GET /api/jobs/id/annotations?format=` API endpoint no longer handles annotations export process
(<https://github.com/cvat-ai/cvat/pull/9075>)
1 change: 0 additions & 1 deletion cvat-ui/src/components/requests-page/request-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ function RequestCard(props: Props): JSX.Element {
const downloadAnchor = window.document.getElementById('downloadAnchor') as HTMLAnchorElement;
downloadAnchor.href = request.url;
downloadAnchor.click();
dispatch(requestsActions.disableRequest(request));
},
});
}
Expand Down
299 changes: 98 additions & 201 deletions cvat/apps/dataset_manager/tests/test_rest_api_formats.py

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions cvat/apps/dataset_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,13 @@ def get_all_formats():
'importers': get_import_formats(),
'exporters': get_export_formats(),
}


def get_export_callback(db_instance: Project | Task | Job, save_images: bool):
if isinstance(db_instance, Project):
return export_project_as_dataset if save_images else export_project_annotations
elif isinstance(db_instance, Task):
return export_task_as_dataset if save_images else export_task_annotations

assert isinstance(db_instance, Job)
return export_job_as_dataset if save_images else export_job_annotations
Loading
Loading