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

Change set_-functions behaviour to not create intermediate structures. #309

Open
blackwinter opened this issue Jun 6, 2023 · 2 comments
Assignees

Comments

@blackwinter
Copy link
Member

blackwinter commented Jun 6, 2023

add_field() and set_field() are going to be equivalent with #308, but according to Catmandu's documentation set_field() "will not create the intermediate structures if they are missing".

Functional review: @TobiasNx
Code review: @blackwinter / @fsteeg

@TobiasNx
Copy link
Collaborator

TobiasNx commented Oct 2, 2024

The aspect of the intermediate structure seems to be true for all fixes of the set_-family so not just for set_field but also for set_array and set_hash. I think that the adjustment for all these fixes makes sense since we want to adjust to the behaviour of Catmandu BUT on the side of lobid and oersi we rely on a fixes that create empty hashes and empty arrays WITH the intermediate structure. So If we move on with this, we should also introduce two new fix functions add_array and add_hash as counterpart to set_hash and set_array.

PS: The new functions add_hash and add_array could reuse the current implementation of set_array and set_hash while the version without creating intermediate structure would replace the the current one.

TobiasNx added a commit that referenced this issue Oct 16, 2024
The are a copy of the current implementation of set_array and set_hash. This is a preparation for #309
TobiasNx added a commit that referenced this issue Oct 16, 2024
As a preliminary work for #309 since set_array will change its behaviour but add_array will keep the functionality.
TobiasNx added a commit that referenced this issue Oct 16, 2024
As a preliminary work for #309 since set_array will change its behaviour but add_array will keep the functionality.
TobiasNx added a commit that referenced this issue Oct 16, 2024
…374

Additional preliminary work for #309 when the set-fixes change their functionality.
@TobiasNx
Copy link
Collaborator

TobiasNx commented Nov 7, 2024

add_array and add_hash are introduced now and the set functions are only aliases now.
We should advise anybody to use the add functions instead of the set ones until the new behaviour is introduced.

Also wenn the behaviour change is implemented we should rename all set_ tests to add_ ones as well as add new set functions.

@TobiasNx TobiasNx changed the title Change set_field() behaviour to not create intermediate structures. Change set_-functions behaviour to not create intermediate structures. Jan 6, 2025
TobiasNx added a commit to hbz/lobid-resources that referenced this issue Jan 6, 2025
With the upcoming releases the behaviour of set_ will change so that no intermediate structure will be created. To prepare for this change we will use the add_ version of these functions. See the following issue for further info: metafacture/metafacture-fix#309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants