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

Added option single to Instance.asdict() allowing to saving in multi-entity format #653

Merged
merged 8 commits into from
Oct 30, 2023

Conversation

jesper-friis
Copy link
Collaborator

Description

Closes #651

This PR adds the option single to Instance.asdict(). If you set single=False the dict-representation will be in multi-entity format, which is the expected format for data instances.

The default is currently set to True to retain the old behaviour. Ideally the default should be None, which would (like the json plugin) save metadata in single-entity format and data instances in multi-entity format.

If we change the default to None, a set of tests will currently fail. Question: should we keep the old behaviour, or spend the time to update all failing tests?

Type of change

  • Bug fix & code cleanup
  • New feature
  • Documentation update
  • Test update

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?

@jesper-friis jesper-friis linked an issue Sep 26, 2023 that may be closed by this pull request
@francescalb francescalb self-requested a review October 25, 2023 07:54
@francescalb
Copy link
Collaborator

I think we should update the failing tests. I can give it a go.

@jesper-friis jesper-friis merged commit fd81874 into master Oct 30, 2023
11 checks passed
@jesper-friis jesper-friis deleted the 651-saving-instance-asdict branch October 30, 2023 10:28
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 this pull request may close these issues.

saving instance asdict cannot be read afterwards
2 participants