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

model.base: make extending a ConstrainedList atomic #116

Conversation

jkhsjdhjs
Copy link
Contributor

Previously partial additions of elements via a call to .extend() were
possible, since the .extend() method of the superclass simply calls
.append() for each item, which in turn calls .insert(). Thus, if the
hook call for one item raised an exception, all previous items had
already been added.

Furthermore, this PR adds tests for the atomicity of extension and deletion operations of ConstrainedList.

Previously partial additions of elements via a call to `.extend()` were
possible, since the `.extend()` method of the superclass simply calls
`.append()` for each item, which in turn calls `.insert()`. Thus, if the
hook call for one item raised an exception, all previous items had
already been added.
@jkhsjdhjs jkhsjdhjs force-pushed the fix/constrained_list_extend_atomicity branch from 5ee39dc to 2dc720e Compare August 29, 2023 14:14
@s-heppner
Copy link
Contributor

This looks good to me as well. Give me a thumbs up if it's ready to be merged.

test/model/test_base.py Outdated Show resolved Hide resolved
@s-heppner s-heppner merged commit 505694d into eclipse-basyx:improve/V30 Aug 31, 2023
5 checks passed
@s-heppner s-heppner deleted the fix/constrained_list_extend_atomicity branch August 31, 2023 13:43
@s-heppner s-heppner added the v3.0 label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants