Skip to content

Commit

Permalink
[SDL-5677][Server][Python SDK] Export KPs Generated With Datafiles, N…
Browse files Browse the repository at this point in the history
…O Queries (#29)

Co-authored-by: Ehsan Kourkchi <[email protected]>
  • Loading branch information
mkaliberda and Ehsan Kourkchi authored Sep 22, 2024
1 parent 92d11d0 commit 1f2fce6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/python_client/sensiml/datamanager/knowledgepack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,12 +1018,12 @@ def initialize_from_dict(self, init_dict):
self._model_index = init_dict.get("model_index", None)
self._execution_time = init_dict.get("execution_time", None)

self._class_map = init_dict["class_map"]
self._pipeline_summary = init_dict["pipeline_summary"]
self._query_summary = init_dict["query_summary"]
self._feature_summary = init_dict["feature_summary"]
self._transform_summary = init_dict["transform_summary"]
self._sensor_summary = init_dict["sensor_summary"]
self._class_map = init_dict.get("class_map")
self._pipeline_summary = init_dict.get("pipeline_summary")
self._query_summary = init_dict.get("query_summary", None)
self._feature_summary = init_dict.get("feature_summary")
self._transform_summary = init_dict.get("transform_summary")
self._sensor_summary = init_dict.get("sensor_summary")

self._neuron_array = (
init_dict.get("neuron_array")
Expand Down
5 changes: 5 additions & 0 deletions src/server/datamanager/serializers/knowledgepack.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ def get_model_configuration(self, obj):

def get_query_summary(self, obj):

empty_dict = {}

if not hasattr(obj, "query_summary") or not obj.query_summary:
return empty_dict # for backward compatibility

obj.query_summary.pop("segment_info", None)

if isinstance(obj.query_summary["segmenter"], int):
Expand Down

0 comments on commit 1f2fce6

Please sign in to comment.