Skip to content

Conversation

markbader
Copy link
Contributor

@markbader markbader commented Apr 3, 2025

Description:

  • This PR adds a bool param to annaounce manual upload to make it fail when the dataset name is already taken. Additionally the request is answered with the dataset_id and the directory_name, these are passed through to the convenience methods.

Issues:

Todos:

Make sure to delete unnecessary points or to check all before merging:

  • Updated Changelog

@MichaelBuessemeyer
Copy link
Contributor

The corresponding wk pr is: scalableminds/webknossos#8476

@MichaelBuessemeyer MichaelBuessemeyer marked this pull request as ready for review April 7, 2025 11:28
@MichaelBuessemeyer MichaelBuessemeyer self-requested a review April 7, 2025 11:28
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thanks for implementing this 👯

I tested this with

def main() -> None:
    with wk.webknossos_context(
            token="<local token>", url="http://localhost:9000"
    ):
        new_name = "new_name"
        print(wk.Dataset.announce_manual_upload(new_name, "sample_organization", [], "67ee5554780100780102eda3", False))
        try:
            print(wk.Dataset.announce_manual_upload(new_name, "sample_organization", [], "67ee5554780100780102eda3", True))
        except Exception as e:
            print("failure expected")
        try:
            print(wk.Dataset.announce_manual_upload(new_name, "sample_organization", [], "67ee5554780100780102eda3", False))
            print("should be printed")
        except Exception as e:
            print("should not be printed")
        print(wk.Dataset.announce_manual_upload("another_new_name", "sample_organization", [], "67ee5554780100780102eda3", True))
        print(wk.Dataset.announce_manual_upload("another_new_name2", "sample_organization", [], "67ee5554780100780102eda3", False))

And everything worked as expected 🎉

Please only merge together with the corresponding wk pr or afterwards

Copy link

github-actions bot commented Apr 17, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8623 7194 83% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
webknossos/webknossos/client/api_client/datastore_api_client.py 90% 🟢
webknossos/webknossos/client/api_client/models.py 100% 🟢
webknossos/webknossos/dataset/dataset.py 85% 🟢
TOTAL 92% 🟢

updated for commit: 9b62370 by action🐍

@markbader markbader merged commit 9d5257c into master Apr 22, 2025
20 checks passed
@markbader markbader deleted the require-unique-manual-upload-name branch April 22, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt reserve manual upload
2 participants