Feature #17635
closedSupport 'preserve_version' flag on Collection.save
100%
Description
- Collection class in the Python SDK should support the "preserve_version" flag on the save() method
- If
preserve_version
istrue
and CollectionVersioning is false in the config, decide which one of these things should happen:- Save a snapshot version as if CollectionVersioning is true (since it was asked for explicitly)
- Return an error (so the user knows the version won't be preserved)
Updated by Peter Amstutz about 3 years ago
- Has duplicate Story #18312: Collection versioning tweaks added
Updated by Peter Amstutz about 3 years ago
- Target version set to 2021-11-24 sprint
Updated by Lucas Di Pentima about 3 years ago
- Status changed from New to In Progress
Updated by Lucas Di Pentima about 3 years ago
Updates at d35c1a749 - branch 17635-pysdk-collection-preserve-version
Test run: developer-run-tests: #2790
- Exports
Collections.CollectionVersioning
config so thatarvados.Collection
knows when to return an error. - Adds
preserve_version
(False
by default) parameter tosave()
andsave_new()
methods on thearvados.Collection
class. When collection versioning isn't enabled and the parameter is set toTrue
, it raises an exception. - Adds tests.
Updated by Peter Amstutz about 3 years ago
Lucas Di Pentima wrote:
Updates at d35c1a749 - branch
17635-pysdk-collection-preserve-version
Test run: developer-run-tests: #2790
- Exports
Collections.CollectionVersioning
config so thatarvados.Collection
knows when to return an error.
I had envisioned that the API server would return an error, instead of just doing a client side check. The main drawback is that it will break clients (like wb2) that always send preserve_version=true. So maybe a client side check is the best we can do. Changing the the API server behavior seems out of scope for this ticket.
- Adds
preserve_version
(False
by default) parameter tosave()
andsave_new()
methods on thearvados.Collection
class. When collection versioning isn't enabled and the parameter is set toTrue
, it raises an exception.
I had to think really hard about how it could make sense to have preserve_version
parameter on save_new()
before remembering the original meaning/behavior of the preserve_version flag (that we make sure the version we just wrote will be preserved on future update). Can we explain it better somehow?
Updated by Lucas Di Pentima about 3 years ago
Updates at b1a88ceac
- Improved documentation
Updated by Peter Amstutz about 3 years ago
Lucas Di Pentima wrote:
Updates at b1a88ceac
- Improved documentation
If True, the newly saved collection will generate a new snapshot of
itself on the next versionable update. This parameter requires that
the Collections.CollectionVersioning is enabled and will raise an
exception otherwise.
Can we rephrase this a little bit, like
"If True, indicate that the collection content being saved right now should be preserved in a version snapshot if the collection record is updated in the future. Requires that the API server has Collections.CollectionVersioning enabled, if not, setting this will raise an exception."
Updated by Lucas Di Pentima about 3 years ago
- Status changed from In Progress to Resolved
Applied in changeset arvados-private:commit:arvados|3849ee94bbe65ef79df8f50c87b5445a5b1d4877.