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

catalog_set yields both "ok" and "impossible" #331

Closed
mslw opened this issue Aug 14, 2023 · 1 comment · Fixed by #333
Closed

catalog_set yields both "ok" and "impossible" #331

mslw opened this issue Aug 14, 2023 · 1 comment · Fixed by #333

Comments

@mslw
Copy link
Collaborator

mslw commented Aug 14, 2023

When a catalog has its homepage already set, directly calling catalog_set(reckless="overwrite") updates the setting, but yields both "ok" and "impossible" results.

catalog_set(ok): catalog [Home page successfully set to: dataset_id=1234, dataset_version=latest.]
catalog_set(impossible): catalog [Home page already set: dataset_id=1234, dataset_version=2137.To overwrite this property, use '--reckless overwrite']
action summary:
  catalog_set (impossible: 1, ok: 1)
(...)
datalad.support.exceptions.IncompleteResultsError: Command did not complete successfully. 1 failed:
(...)

This is because when catalog_set() is called, yield does not terminate execution, and the code seems to be taking a shortcut / missing an else statement.

(although, when used inside another function, yield from catalog_set() would indeed stop at first yield.

@jsheunis
Copy link
Member

jsheunis commented Sep 1, 2023

Thanks for catching this @mslw ! I will fix it up and work it into the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants