Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Adding options to the Python plugin from_bytes() and to_bytes() methods #880
Adding options to the Python plugin from_bytes() and to_bytes() methods #880
Changes from 3 commits
325b1b2
4d66bcb
15f9452
3647ff0
f87072e
8712eaf
c8496db
ef5b08b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have two argumenter for the same things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soft7
andwith_uuid
are not the same thing. Withsoft7=True
dimensions and properties will be dicts, otherwise they will be arrays.with_uuid=True
simply adds anuuid
key to the return representation.Or did I misunderstood your question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I measn with_uuid and single. They have the same description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me the option descriptions look different:
The
with_uuid=true
option includes an "uuid" field next to "meta", "description", "dimensions" and "properties", whilesingle=false
creates another level of nesting using the UUID as key for the instance. So withsingle=true;with_uuid=false
no UUID will be included in the output. While withsingle=false;with_uuid=true
the UUID will be shown twice.But I see some possible improvements:
with_uuid
could be renamed towith-uuid
for consistency with the json pluginsingle
option for controlling for output (this is how it is used in the json plugin)to_bytes()
andfrom_bytes()
in the json storage plugin #881, the json plugin could be used directly, instead of relying on separate Python-implementations ofInstance.asdict()
anddlite.utils.instance_from_dict()
. That would simplify things and improve consistencyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just look at line 158 and 159 here (above and below this comment section. 'single' and 'with_uuid' have the same description.
I think it is very good to be consistent with the json plugin.