Skip to content

Unexpected behaviour in annotation store when property key has a . in it #771

@measty

Description

@measty
  • TIA Toolbox version: All
  • Python version: All
  • Operating System: All

Description

If a properties dictionary of an annotation has a . in it, some operations of AnnotationStore behave unexpectedly if the operation involves the usage of json_extract

Cause

The root of the issue is in the line:

return f"json_extract(properties, {json.dumps(f'$.{self.acc}')})"

In the case of a key which contains a . this ends up being incorrectly parsed. For example, if properties dict has a key 'MSI.status' and you try to do an operation which needs to access that property from the json, it gets parsed into a json_extract function call that instead of accessing a field 'MSI.status' in the JSON, tries to access a subfield 'status' of a field 'MSI' in the JSON

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions