Skip to content

Commit 2e525ab

Browse files
authored
Create method for update datastore after manual upload of new dataset (#1236)
* Add trigger for checking datastore inbox. * Update Changelog. * Use route for single dataset refresh instead. * Implement requested feedback.
1 parent 0282eb8 commit 2e525ab

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

webknossos/Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
2121
- `Dataset` method `get_remote_datasets()` accepts `name` and `folder_id` as arguments now to filter remote datasets.
2222
- `RemoteDataset` got an additional property: `created`.
2323
- `Annotation` got an additional property: `dataset_id`.
24+
- `Dataset.trigger_dataset_import()` was added to refresh the datastore to register a newly added dataset. [#1236](https://github.com/scalableminds/webknossos-libs/pull/1236)
2425

2526
### Changed
26-
- Updated to WEBKNOSSOS API version 9. This includes support for the new url structure for datasets and [#1231](https://github.com/scalableminds/webknossos-libs/pull/1231)
27+
- Updated to WEBKNOSSOS API version 9. This includes support for the new url structure for datasets and the usage of `dataset_id`. [#1231](https://github.com/scalableminds/webknossos-libs/pull/1231)
2728

2829
### Fixed
2930
- Fixed Mag setup for non-public datasets. [#1222](https://github.com/scalableminds/webknossos-libs/pull/1222)

webknossos/webknossos/dataset/dataset.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,26 @@ def trigger_reload_in_datastore(
567567
datastore_api = context.get_datastore_api_client(upload_url)
568568
datastore_api.dataset_trigger_reload(organization, dataset_name, token=token)
569569

570+
@classmethod
571+
def trigger_dataset_import(
572+
cls, directory_name: str, organization: str, token: Optional[str] = None
573+
) -> None:
574+
"""Trigger a manual lookup of the dataset in the datastore.
575+
576+
Args:
577+
directory_name: Directory name of the dataset in the datastore
578+
organization: Organization ID where dataset is located
579+
token: Optional authentication token
580+
581+
Examples:
582+
```
583+
# Trigger a manual lookup of the dataset in the datastore
584+
Dataset.trigger_dataset_upload("l4_sample", "scalable_minds")
585+
```
586+
"""
587+
588+
cls.trigger_reload_in_datastore(directory_name, organization, token)
589+
570590
@classmethod
571591
def _disambiguate_remote(
572592
cls,

0 commit comments

Comments
 (0)