datamaker-py 0.11.1__tar.gz → 0.11.2__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 (40) hide show
  1. {datamaker_py-0.11.1/src/datamaker_py.egg-info → datamaker_py-0.11.2}/PKG-INFO +1 -1
  2. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/pyproject.toml +1 -1
  3. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/generated/schema.py +2 -0
  4. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/main.py +4 -1
  5. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/tosca.py +15 -3
  6. {datamaker_py-0.11.1 → datamaker_py-0.11.2/src/datamaker_py.egg-info}/PKG-INFO +1 -1
  7. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/tests/test_tosca.py +36 -1
  8. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/LICENSE +0 -0
  9. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/README.md +0 -0
  10. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/setup.cfg +0 -0
  11. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/__init__.py +0 -0
  12. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/core.py +0 -0
  13. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/error.py +0 -0
  14. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/generated/__init__.py +0 -0
  15. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/__init__.py +0 -0
  16. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/api_keys.py +0 -0
  17. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/base.py +0 -0
  18. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/connections.py +0 -0
  19. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/custom_types.py +0 -0
  20. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/export_and_validation.py +0 -0
  21. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/folders_and_utils.py +0 -0
  22. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/generation.py +0 -0
  23. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/keymaps.py +0 -0
  24. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/masking_policies.py +0 -0
  25. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/plans.py +0 -0
  26. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/projects.py +0 -0
  27. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/scenario_files.py +0 -0
  28. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/sets.py +0 -0
  29. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/teams.py +0 -0
  30. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/templates.py +0 -0
  31. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/routes/users.py +0 -0
  32. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/template.py +0 -0
  33. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker/types.py +0 -0
  34. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker_py.egg-info/SOURCES.txt +0 -0
  35. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker_py.egg-info/dependency_links.txt +0 -0
  36. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker_py.egg-info/requires.txt +0 -0
  37. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/src/datamaker_py.egg-info/top_level.txt +0 -0
  38. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/tests/test_integration.py +0 -0
  39. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/tests/test_main.py +0 -0
  40. {datamaker_py-0.11.1 → datamaker_py-0.11.2}/tests/test_routes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datamaker-py
3
- Version: 0.11.1
3
+ Version: 0.11.2
4
4
  Summary: The official Python library for the Automators DataMaker API.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "datamaker-py"
7
- version = "0.11.1"
7
+ version = "0.11.2"
8
8
  description = "The official Python library for the Automators DataMaker API."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -2237,6 +2237,7 @@ class Subsets(TypedDict):
2237
2237
  created: list[str]
2238
2238
  existing: list[str]
2239
2239
  skipped: int
2240
+ unaddressable: list[str]
2240
2241
 
2241
2242
 
2242
2243
  class ToscaDatasetPush(TypedDict):
@@ -2249,6 +2250,7 @@ class ToscaDatasetPush(TypedDict):
2249
2250
  rowsCount: int
2250
2251
  space: str
2251
2252
  subsets: Subsets
2253
+ unaddressableColumns: list[str]
2252
2254
 
2253
2255
 
2254
2256
  class Parameter(TypedDict):
@@ -999,7 +999,10 @@ class DataMaker:
999
999
  Returns:
1000
1000
  A result with dataset_id, name, space, rows_count, outcome
1001
1001
  ("created", "overwritten", "recreated" or "copied"), columns,
1002
- added_columns, subsets and example.
1002
+ added_columns, subsets, unaddressable_columns and example.
1003
+ Names holding [ or ] cannot appear in {TDM[...]}: such columns are
1004
+ listed in unaddressable_columns and such subset values in
1005
+ subsets["unaddressable"].
1003
1006
 
1004
1007
  Raises:
1005
1008
  ReadOnlyConnectionError: The connection is read-only (403).
@@ -43,8 +43,12 @@ class ToscaDatasetPushResult:
43
43
  columns: List[Dict[str, str]] = field(default_factory=list)
44
44
  # Columns an overwrite added to the existing data set
45
45
  added_columns: List[str] = field(default_factory=list)
46
- # {"created": [names], "existing": [names], "skipped": count}
46
+ # {"created": [names], "existing": [names], "skipped": count,
47
+ # "unaddressable": [values with [ or ], which {TDM[...]} cannot address]}
47
48
  subsets: Dict[str, Any] = field(default_factory=dict)
49
+ # Columns a test step cannot read by name because they hold [ or ]. Their
50
+ # data is in the data set; rename them to read it with {TDM[...]}.
51
+ unaddressable_columns: List[str] = field(default_factory=list)
48
52
  # The API's response as sent, for fields this class does not name yet.
49
53
  raw: ToscaDatasetPush = field(
50
54
  default_factory=lambda: cast(ToscaDatasetPush, {}), repr=False, compare=False
@@ -128,7 +132,11 @@ class ToscaClient(BaseClient):
128
132
  Returns:
129
133
  A ``ToscaDatasetPushResult`` with ``dataset_id``, ``name``,
130
134
  ``space``, ``rows_count``, ``outcome``, ``columns``,
131
- ``added_columns``, ``subsets`` and ``example``.
135
+ ``added_columns``, ``subsets``, ``unaddressable_columns`` and
136
+ ``example``. Names holding ``[`` or ``]`` cannot appear in
137
+ ``{TDM[...]}``: such columns are listed in
138
+ ``unaddressable_columns`` and such subset values in
139
+ ``subsets["unaddressable"]``.
132
140
 
133
141
  Raises:
134
142
  DataMakerError: If the arguments do not describe exactly one source.
@@ -240,7 +248,11 @@ class ToscaClient(BaseClient):
240
248
  for column in data["columns"]
241
249
  ],
242
250
  added_columns=data["addedColumns"],
243
- subsets=dict(data["subsets"]),
251
+ # "unaddressable" is always present, so callers can index it even
252
+ # against an API from before datamaker#3683, which omits it.
253
+ subsets={"unaddressable": [], **dict(data["subsets"])},
254
+ # Read with .get: an API from before datamaker#3683 omits the key.
255
+ unaddressable_columns=list(data.get("unaddressableColumns") or []),
244
256
  raw=data,
245
257
  )
246
258
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datamaker-py
3
- Version: 0.11.1
3
+ Version: 0.11.2
4
4
  Summary: The official Python library for the Automators DataMaker API.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -78,7 +78,12 @@ class TestPushToscaDataset:
78
78
  assert result.outcome == "created"
79
79
  assert result.columns == [{"name": "Customer", "type": "String"}]
80
80
  assert result.added_columns == []
81
- assert result.subsets == {"created": ["TC-1"], "existing": [], "skipped": 0}
81
+ assert result.subsets == {
82
+ "created": ["TC-1"],
83
+ "existing": [],
84
+ "skipped": 0,
85
+ "unaddressable": [],
86
+ }
82
87
  assert result.example == "{TDM[Orders][Customer]}"
83
88
  assert result.raw == PUSHED
84
89
 
@@ -135,6 +140,36 @@ class TestPushToscaDataset:
135
140
  assert result.outcome == "overwritten"
136
141
  assert result.added_columns == ["Region"]
137
142
 
143
+ @patch("requests.request")
144
+ def test_reports_names_tdm_cannot_address(self, mock_request, api_key):
145
+ mock_request.return_value = ok(
146
+ {
147
+ **PUSHED,
148
+ "subsets": {
149
+ "created": ["Checkout"],
150
+ "existing": [],
151
+ "skipped": 0,
152
+ "unaddressable": ["Checkout [smoke]"],
153
+ },
154
+ "unaddressableColumns": ["Price [EUR]"],
155
+ }
156
+ )
157
+
158
+ result = push(api_key, input_set_id="is-1")
159
+
160
+ assert result.unaddressable_columns == ["Price [EUR]"]
161
+ assert result.subsets["unaddressable"] == ["Checkout [smoke]"]
162
+
163
+ @patch("requests.request")
164
+ def test_api_without_unaddressable_fields_still_parses(self, mock_request, api_key):
165
+ # PUSHED is the response shape from before datamaker#3683.
166
+ mock_request.return_value = ok()
167
+
168
+ result = push(api_key, input_set_id="is-1")
169
+
170
+ assert result.unaddressable_columns == []
171
+ assert result.subsets["unaddressable"] == []
172
+
138
173
  @patch("requests.request")
139
174
  def test_subsets_can_be_turned_off(self, mock_request, api_key):
140
175
  mock_request.return_value = ok()
File without changes
File without changes
File without changes