🔧 fix(store.py): modify metadata structure to include count for each name and total count to improve data analysis capabilities

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-27 13:03:27 -03:00
commit bfc74367b5

View file

@ -75,7 +75,8 @@ def create_component(
# "SomeType": 1
# }
names = [node["id"].split("-")[0] for node in component.data["nodes"]]
metadata = {name: names.count(name) for name in names}
metadata = {name: {"count": names.count(name)} for name in names}
metadata["total"] = len(names)
component.metadata = metadata
return store_service.upload(store_api_Key, component)
except Exception as exc: