🔧 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:
parent
4016c28573
commit
bfc74367b5
1 changed files with 2 additions and 1 deletions
|
|
@ -75,7 +75,8 @@ def create_component(
|
||||||
# "SomeType": 1
|
# "SomeType": 1
|
||||||
# }
|
# }
|
||||||
names = [node["id"].split("-")[0] for node in component.data["nodes"]]
|
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
|
component.metadata = metadata
|
||||||
return store_service.upload(store_api_Key, component)
|
return store_service.upload(store_api_Key, component)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue