wizata-dsapi 2.0.1__tar.gz → 2.1.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. {wizata_dsapi-2.0.1/wizata_dsapi.egg-info → wizata_dsapi-2.1.0.dev2}/PKG-INFO +1 -1
  2. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/pipeline.py +20 -4
  3. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/pipeline_image.py +21 -4
  4. wizata_dsapi-2.1.0.dev2/wizata_dsapi/version.py +1 -0
  5. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2/wizata_dsapi.egg-info}/PKG-INFO +1 -1
  6. wizata_dsapi-2.0.1/wizata_dsapi/version.py +0 -1
  7. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/LICENSE.txt +0 -0
  8. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/README.rst +0 -0
  9. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/setup.cfg +0 -0
  10. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/setup.py +0 -0
  11. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/__init__.py +0 -0
  12. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/api_config.py +0 -0
  13. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/api_dto.py +0 -0
  14. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/api_interface.py +0 -0
  15. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/bucket.py +0 -0
  16. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/business_label.py +0 -0
  17. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/context.py +0 -0
  18. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/dashboard.py +0 -0
  19. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/dataframe_toolkit.py +0 -0
  20. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/datapoint.py +0 -0
  21. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/datastore.py +0 -0
  22. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/ds_dataframe.py +0 -0
  23. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/dsapi_json_encoder.py +0 -0
  24. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/edge_config.py +0 -0
  25. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/edge_device.py +0 -0
  26. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/edge_module.py +0 -0
  27. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/evaluation.py +0 -0
  28. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/execution.py +0 -0
  29. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/execution_log.py +0 -0
  30. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/experiment.py +0 -0
  31. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/graylog_log.py +0 -0
  32. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/group_system.py +0 -0
  33. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/ilogger.py +0 -0
  34. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/insight.py +0 -0
  35. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/mlmodel.py +0 -0
  36. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/mobile_asset.py +0 -0
  37. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/model_toolkit.py +0 -0
  38. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/models/__init__.py +0 -0
  39. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/models/common.py +0 -0
  40. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/notification.py +0 -0
  41. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/paged_query_result.py +0 -0
  42. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/plot.py +0 -0
  43. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/plots/__init__.py +0 -0
  44. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/plots/common.py +0 -0
  45. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/plots/theme.py +0 -0
  46. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/request.py +0 -0
  47. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/script.py +0 -0
  48. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/scripts/__init__.py +0 -0
  49. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/scripts/common.py +0 -0
  50. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/search.py +0 -0
  51. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/solution_component.py +0 -0
  52. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/streamlit_utils.py +0 -0
  53. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/template.py +0 -0
  54. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/template_config.py +0 -0
  55. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/trigger.py +0 -0
  56. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/twin.py +0 -0
  57. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/twinregistration.py +0 -0
  58. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/user.py +0 -0
  59. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/wizard_function.py +0 -0
  60. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/wizard_request.py +0 -0
  61. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/wizata_dsapi_client.py +0 -0
  62. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi/words.py +0 -0
  63. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
  64. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
  65. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi.egg-info/requires.txt +0 -0
  66. {wizata_dsapi-2.0.1 → wizata_dsapi-2.1.0.dev2}/wizata_dsapi.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizata_dsapi
3
- Version: 2.0.1
3
+ Version: 2.1.0.dev2
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -588,6 +588,10 @@ class Pipeline(ApiDto):
588
588
  self.createdDate = None
589
589
  self.updatedById = None
590
590
  self.updatedDate = None
591
+ # Transient: which branch/ref this DTO was read from. The server
592
+ # sets it in responses so the FE knows where edits will land; clients
593
+ # are free to omit it on writes (the URL path carries the branch).
594
+ self.branch = None
591
595
  self.plots = plots
592
596
  if plots is None:
593
597
  self.plots = []
@@ -956,12 +960,20 @@ class Pipeline(ApiDto):
956
960
  self.updatedById = obj["updatedById"]
957
961
  if "updatedDate" in obj.keys() and obj["updatedDate"] is not None:
958
962
  self.updatedDate = obj["updatedDate"]
963
+ # Transient: only relevant on reads. Ignored if absent.
964
+ if "branch" in obj.keys() and obj["branch"] is not None:
965
+ self.branch = str(obj["branch"])
959
966
 
960
967
  def to_json(self, target: str = None):
961
968
  """
962
969
  Convert to a json version of Execution definition.
963
- By default, use DS API format.
970
+ By default, use DS API format (steps/plots/variables are stringified
971
+ JSON, matching the C# backend SQL column shape).
972
+ target="git" emits steps/plots/variables as nested JSON instead, so
973
+ git-stored pipeline files have human-readable diffs and merge cleanly.
974
+ from_json() accepts both forms transparently.
964
975
  """
976
+ as_git = target == "git"
965
977
  obj = {
966
978
  "id": str(self.pipeline_id)
967
979
  }
@@ -972,12 +984,12 @@ class Pipeline(ApiDto):
972
984
  step: PipelineStep
973
985
  for step in self.steps:
974
986
  obj_steps.append(step.to_json())
975
- obj["steps"] = json.dumps(obj_steps)
987
+ obj["steps"] = obj_steps if as_git else json.dumps(obj_steps)
976
988
  if self.plots is not None:
977
- obj["plots"] = json.dumps(self.plots)
989
+ obj["plots"] = list(self.plots) if as_git else json.dumps(self.plots)
978
990
  if self.variables is not None:
979
991
  self.check_variables()
980
- obj["variables"] = json.dumps(self.variables)
992
+ obj["variables"] = dict(self.variables) if as_git else json.dumps(self.variables)
981
993
  if self.template_id is not None:
982
994
  obj["templateId"] = str(self.template_id)
983
995
  if self.experiment_id is not None:
@@ -990,6 +1002,10 @@ class Pipeline(ApiDto):
990
1002
  obj["updatedById"] = str(self.updatedById)
991
1003
  if self.updatedDate is not None:
992
1004
  obj["updatedDate"] = str(self.updatedDate)
1005
+ # Server-set transient — only useful on responses. Omitted from the
1006
+ # git-store payload so we don't add noise into committed JSON.
1007
+ if not as_git and self.branch is not None:
1008
+ obj["branch"] = self.branch
993
1009
  return obj
994
1010
 
995
1011
  def _save_related_entities(self, obj: dict) -> dict:
@@ -68,16 +68,28 @@ class PipelineImage(ApiDto):
68
68
  if self.pipeline_image_id is None:
69
69
  raise ValueError(f'pipeline_image_id cannot be None')
70
70
 
71
+ # Old format: {datetime}.v{ver}.{key}
72
+ # New format: {datetime}.v{ver}.{key}.{git_sha_short}
73
+ # Pipeline keys are constrained to [A-Za-z0-9_-]{1,32} (no dots), so a
74
+ # third dot unambiguously separates the key from the optional SHA.
71
75
  first_dot = self.pipeline_image_id.index('.')
72
76
  second_dot = self.pipeline_image_id.index('.', first_dot + 1)
77
+ third_dot = self.pipeline_image_id.find('.', second_dot + 1)
73
78
 
74
79
  datetime_part = self.pipeline_image_id[:first_dot]
75
80
  version_part = self.pipeline_image_id[first_dot + 1:second_dot].replace('_', '.')[1:]
76
- key_part = self.pipeline_image_id[second_dot + 1:]
81
+ if third_dot == -1:
82
+ key_part = self.pipeline_image_id[second_dot + 1:]
83
+ git_sha = None
84
+ else:
85
+ key_part = self.pipeline_image_id[second_dot + 1:third_dot]
86
+ git_sha = self.pipeline_image_id[third_dot + 1:] or None
87
+
77
88
  return {
78
89
  'datetime': int(datetime.strptime(datetime_part, '%Y%m%d%H%M%S').replace(tzinfo=pytz.UTC).timestamp() * 1000),
79
90
  'version': version_part,
80
- 'key': key_part
91
+ 'key': key_part,
92
+ 'git_sha': git_sha,
81
93
  }
82
94
 
83
95
  def to_json(self, target: str = None):
@@ -146,12 +158,17 @@ class PipelineImage(ApiDto):
146
158
  base_name = json_file[:-5]
147
159
  pkl_file = base_name + '.pkl'
148
160
 
161
+ script = Script.from_dict(json.loads(g_files[json_file]))
149
162
  if pkl_file in script_files:
150
- script = Script.from_dict(json.loads(g_files[json_file]))
163
+ # API scripts: pkl carries the dill-serialised callable.
151
164
  script.function = Script.load_function_from_dill(g_files[pkl_file])
152
- image.scripts.append(script)
165
+ elif script.script_type == wizata_dsapi.ScriptType.RAW:
166
+ # RAW scripts: the python source rides in the JSON; no pkl
167
+ # is expected. Runtime path compiles script.source on use.
168
+ pass
153
169
  else:
154
170
  raise KeyError(f"missing pkl for script json {json_file}")
171
+ image.scripts.append(script)
155
172
 
156
173
  for pkl_file in pkl_files:
157
174
  base_name = pkl_file[:-4]
@@ -0,0 +1 @@
1
+ __version__ = "2.1.0.dev2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wizata_dsapi
3
- Version: 2.0.1
3
+ Version: 2.1.0.dev2
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -1 +0,0 @@
1
- __version__ = "2.0.1"
File without changes