UncountablePythonSDK 0.0.173.dev2__py3-none-any.whl → 0.0.175__py3-none-any.whl

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.
docs/.flowmarkignore ADDED
@@ -0,0 +1,9 @@
1
+ # Flowmark collapses the MyST {tab-set}/{tab-item} directives in index.md,
2
+ # which breaks the Sphinx build. flowmark-rs 0.3.1 ignores file patterns in
3
+ # [tool.flowmark] extend-exclude, so the exclusion lives here instead.
4
+ # Both pattern forms are required: the anchored form applies to directory
5
+ # walks (relative to this directory); the repo-root-relative form applies
6
+ # when the file is passed explicitly under --force-exclude (matched against
7
+ # the cwd-relative path, and just recipes always run from the repo root).
8
+ /index.md
9
+ sdk/docs/index.md
@@ -1,6 +1,7 @@
1
1
  # Add a File to a Folder
2
2
 
3
- This is a two-step workflow: first upload the file using `upload_files`, then place it in a target folder using `add_file_to_folder`.
3
+ This is a two-step workflow: first upload the file using `upload_files`, then place it in a target
4
+ folder using `add_file_to_folder`.
4
5
 
5
6
  ## Step 1: Upload the file
6
7
 
@@ -54,4 +55,3 @@ response = client.add_file_to_folder(
54
55
  folder_key=identifier_t.IdentifierKeyRefName(ref_name="root"),
55
56
  )
56
57
  ```
57
-
@@ -4,7 +4,8 @@ Use the `create_or_update_entity` method to create Ingredients.
4
4
 
5
5
  The following fields are required when creating an Ingredient:
6
6
  - `name`: The name of the Ingredient
7
- - `core_ingredient_ingredientMaterialFamilies`: The list of material families in which to include the Ingredient
7
+ - `core_ingredient_ingredientMaterialFamilies`: The list of material families in which to include
8
+ the Ingredient
8
9
 
9
10
  The reference name of the default definition of Ingredients is `uncIngredient`
10
11
 
@@ -1,6 +1,7 @@
1
1
  # Upload Files
2
2
 
3
- This example demonstrates the efficient way to upload files using the External API SDK's `client.upload_files()` method.
3
+ This example demonstrates the efficient way to upload files using the External API SDKs
4
+ `client.upload_files()` method.
4
5
 
5
6
  ```python
6
7
  from io import BytesIO
@@ -6,7 +6,7 @@ NON_DISCRIMINATED_UNION_EXCEPTIONS = [
6
6
  "output_parameters.AnalyticalMethodLinkedOptionValue",
7
7
  "recipes_redirect.RecipesRedirectResult",
8
8
  "value_spec.ResolvedPathAll",
9
- "weighted_sum.WeightedSumEntitiesOld",
9
+ "deprecated_calculation_types.DeprecatedWeightedSumEntitiesV0",
10
10
  "workflows.WorkflowTotalDisplay",
11
11
  "type_info.TypeFormActionConstraint",
12
12
  "structured_loading.CompatibleFilterNode",
@@ -135,7 +135,9 @@ def _get_cgroup_memory_limit_bytes() -> int | None:
135
135
  def run_queued_job(
136
136
  queued_job: queued_job_t.QueuedJob,
137
137
  ) -> job_definition_t.JobResult:
138
- with get_otel_tracer().start_as_current_span(name="run_queued_job") as span:
138
+ with get_otel_tracer().start_as_current_span(
139
+ name=f"run_queued_job: {queued_job.job_ref_name}"
140
+ ) as span:
139
141
  if resource is not None:
140
142
  cgroup_limit = _get_cgroup_memory_limit_bytes()
141
143
  if cgroup_limit is not None:
@@ -15,7 +15,6 @@ from typing import Generator, assert_never, cast
15
15
  import psutil
16
16
  from opentelemetry import _logs, trace
17
17
  from opentelemetry._logs import Logger as OTELLogger, LogRecord
18
- from opentelemetry.context import get_current
19
18
  from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
20
19
  from opentelemetry.sdk._logs import (
21
20
  LoggerProvider,
@@ -52,8 +51,15 @@ def _cast_attributes(attributes: dict[str, base_t.JsonValue]) -> Attributes:
52
51
 
53
52
 
54
53
  def one_line_formatter(record: ReadableLogRecord) -> str:
55
- json_data = record.to_json()
56
- return json.dumps(json.loads(json_data), separators=(",", ":")) + "\n"
54
+ payload = json.loads(record.to_json())
55
+
56
+ trace_id = record.log_record.trace_id
57
+ span_id = record.log_record.span_id
58
+ if trace_id:
59
+ payload["dd.trace_id"] = trace.format_trace_id(trace_id)
60
+ if span_id:
61
+ payload["dd.span_id"] = str(span_id)
62
+ return json.dumps(payload, separators=(",", ":")) + "\n"
57
63
 
58
64
 
59
65
  @functools.cache
@@ -114,22 +120,28 @@ def _get_severity_number(severity: LogSeverity) -> _logs.SeverityNumber:
114
120
 
115
121
 
116
122
  class Logger:
117
- current_span: Span
123
+ base_span: Span
118
124
  _bound_attributes: dict[str, base_t.JsonValue]
119
125
  _scope_attributes_stack: list[dict[str, base_t.JsonValue]]
120
126
 
121
127
  def __init__(self, base_span: Span) -> None:
122
- self.current_span = base_span
128
+ self.base_span = base_span
123
129
  self._bound_attributes = {}
124
130
  self._scope_attributes_stack = []
125
131
 
126
132
  @property
127
- def current_span_id(self) -> int:
128
- return self.current_span.get_span_context().span_id
133
+ def base_span_id(self) -> int:
134
+ return self.base_span.get_span_context().span_id
129
135
 
130
136
  @property
131
- def current_trace_id(self) -> int | None:
132
- return self.current_span.get_span_context().trace_id
137
+ def trace_id(self) -> int | None:
138
+ return self.base_span.get_span_context().trace_id
139
+
140
+ def _current_span_with_fallback(self) -> Span:
141
+ active_span = trace.get_current_span()
142
+ if active_span.get_span_context().is_valid:
143
+ return active_span
144
+ return self.base_span
133
145
 
134
146
  def _patch_attributes(
135
147
  self,
@@ -163,6 +175,7 @@ class Logger:
163
175
  self, message: str, *, severity: LogSeverity, attributes: Attributes | None
164
176
  ) -> None:
165
177
  otel_logger = get_otel_logger()
178
+
166
179
  log_record = LogRecord(
167
180
  body=message,
168
181
  severity_text=severity,
@@ -170,7 +183,7 @@ class Logger:
170
183
  attributes=self._patch_attributes(
171
184
  message=message, severity=severity, attributes=attributes
172
185
  ),
173
- context=get_current(),
186
+ context=trace.set_span_in_context(self._current_span_with_fallback()),
174
187
  severity_number=_get_severity_number(severity),
175
188
  )
176
189
  otel_logger.emit(log_record)
@@ -218,7 +231,7 @@ class Logger:
218
231
  patched_attributes = self._patch_attributes(
219
232
  message=message, severity=severity, attributes=attributes
220
233
  )
221
- self.current_span.record_exception(
234
+ self._current_span_with_fallback().record_exception(
222
235
  exception=exception, attributes=patched_attributes
223
236
  )
224
237
  log_message = f"{message}\nexception: {exception}{traceback_str}"
@@ -154,6 +154,7 @@ class RecipeStep:
154
154
  name: str | None
155
155
  recipe_step_id: base_t.ObjectId
156
156
  recipe_step_number: int
157
+ display_mix_order_number: int | None = None
157
158
  instructions: str | None = None
158
159
 
159
160
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.173.dev2
3
+ Version: 0.0.175
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -53,7 +53,8 @@ Requires-Dist: pytest-xdist==3.*; extra == "test"
53
53
  # Uncountable Python SDK
54
54
 
55
55
  ## Documentation
56
- [https://uncountableinc.github.io/uncountable-python-sdk/](https://uncountableinc.github.io/uncountable-python-sdk/)
56
+
57
+ https://uncountableinc.github.io/uncountable-python-sdk/
57
58
 
58
59
  ## Installation
59
60
 
@@ -62,4 +63,3 @@ Install from PyPI:
62
63
  ```console
63
64
  pip install UncountablePythonSDK
64
65
  ```
65
-
@@ -1,13 +1,14 @@
1
+ docs/.flowmarkignore,sha256=gmJziQDpI3zbfHFgM73BE9iaLn04Oqya_7QCjJ749o8,548
1
2
  docs/.gitignore,sha256=_ebkZUcwfvfnGEJ95rfj1lxoBNd6EE9ZvtOc7FsbfFE,7
2
3
  docs/conf.py,sha256=Ky-_Y76T7pwN2aBG-dSF79Av70e7ASgcOXEdQ1qyor4,3542
3
4
  docs/index.md,sha256=g4Yi5831fEkywYkkcFohYLkKzSI91SOZF7DxKsm9zgI,3193
4
5
  docs/justfile,sha256=WymCEQ6W2A8Ak79iUPmecmuaUNN2htb7STUrz5K7ELE,273
5
6
  docs/requirements.txt,sha256=8aqtVaNV4AlzUZ7nAM8kxOF1ccAcujhQ_ayU9Whksf8,172
6
- docs/integration_examples/add_file_to_folder.md,sha256=-8mSReDFaPyDQeAkWyY0x5oFR_NkF81K6PpMKmhNMXY,1557
7
- docs/integration_examples/create_ingredient.md,sha256=bzTQ943YhINxa3HQylEA26rbAsjr6HvvN_HkVkrzUeA,1547
7
+ docs/integration_examples/add_file_to_folder.md,sha256=ZCv8miP7ZlPjor-ZGDwy2oucyopqMPa3aXlmOEfbX10,1556
8
+ docs/integration_examples/create_ingredient.md,sha256=ufzAzPyGaDr9rCBDMGQAE8xahsCMkVfG8VLs1pb3qr0,1549
8
9
  docs/integration_examples/create_output.md,sha256=aDn2TjzKgY-HnxnvgsZS578cvajmHpF1y2HKkHfdtd4,2104
9
10
  docs/integration_examples/index.md,sha256=V0vJKMIqDadsSRW0wkUa4CQ2cq5RUWM4gMlPHz_18t4,104
10
- docs/integration_examples/upload_file.md,sha256=UdDoJasJQkI36iHjLKCFoAfDV4sxzmpg9TqzrfzQbWs,909
11
+ docs/integration_examples/upload_file.md,sha256=eWtWTRnuV6EvhnnagnJ2o0RF9XkPWzX4izIqDWt1NZg,911
11
12
  docs/static/logo_blue.png,sha256=SyYpMTVhhBbhF5Wl8lWaVwz-_p1MIR6dW6bVhufQRME,46708
12
13
  docs/static/favicons/android-chrome-192x192.png,sha256=XoF-AhD55JlSBDGsEPJKfT_VeXT-awhwKyZnxLhrwvk,1369
13
14
  docs/static/favicons/android-chrome-512x512.png,sha256=1S4xwY9YtJQ5ifFsZ-DOzssoyBYs0t9uwdOUmYx0Xso,3888
@@ -94,7 +95,7 @@ pkgs/type_spec/emit_python.py,sha256=zQXAw-vPbv-YCic5qXCebW5LhXTo9sUqwJ3d9aG48w4
94
95
  pkgs/type_spec/emit_typescript.py,sha256=Qu9f1Yv_wc449KHcBGO58hatbzvPvgMbZ11jferi3oY,11567
95
96
  pkgs/type_spec/emit_typescript_util.py,sha256=fNPgSMf3jA66_STGqN4cuH0rH3CvGLc3TKQIEdHxGYA,13558
96
97
  pkgs/type_spec/load_types.py,sha256=1a8-AGVfpZTOiB8G-JW_1NhMZLg_SINaaKH6l2IrbW8,5045
97
- pkgs/type_spec/non_discriminated_union_exceptions.py,sha256=vkKyTESIc0-FENhxenLiFDAvxxBTQNlWLqh-3tAFvus,651
98
+ pkgs/type_spec/non_discriminated_union_exceptions.py,sha256=zfYHKhmq3Q7g6vB4tkno8pZj_F8enbSn_CjCJgJAu80,676
98
99
  pkgs/type_spec/open_api_util.py,sha256=LX6ny4xNOWXQO3qWVM8elrSDTqWsj_7jFplax2POShE,7992
99
100
  pkgs/type_spec/test.py,sha256=4ueujBq-pEgnX3Z69HyPmD-bullFXmpixcpVzfOkhP4,489
100
101
  pkgs/type_spec/util.py,sha256=S_SGTJU192x-wIbngVUTvXhQENMbBfxluigLmnItGI8,4848
@@ -136,7 +137,7 @@ uncountable/integration/request_context.py,sha256=N_FJJxqvfUJ0yV9h3I3vFTGNJiDfyL
136
137
  uncountable/integration/scan_profiles.py,sha256=iTpzYKBHarlhYG6CKYtyAmQ7vUhEUbj2icGVHell8AU,3059
137
138
  uncountable/integration/scheduler.py,sha256=BajQ4txvgEBw8S9x1P0eGm-uBkKp_oecJK65SQd2hNw,8477
138
139
  uncountable/integration/server.py,sha256=P4RRGwU9jMselHPWbU6GxhRLgVtN7Ydcxr18sFn2zI8,5778
139
- uncountable/integration/telemetry.py,sha256=PjhwT55KSYuswQS5rqNDYFIU2MWDqNXHF42gKp5kQBs,15534
140
+ uncountable/integration/telemetry.py,sha256=7IWhCxchtVYJwwwFYduwnMEUdxO8srx2RnocLzcQmtg,15965
140
141
  uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
142
  uncountable/integration/db/connect.py,sha256=mE3bdV0huclH2iT_dXCQdRL4LkjIuf_myAR64RTWXEs,498
142
143
  uncountable/integration/db/session.py,sha256=96cGQXpe6IugBTdSsjdP0S5yhJ6toSmbVB6qhc3FJzE,693
@@ -150,7 +151,7 @@ uncountable/integration/queue_runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
150
151
  uncountable/integration/queue_runner/job_scheduler.py,sha256=MrQLYB4UqkUXKRPDHTqc6C6ZlQ3i8Cy-qopnqZQZbWE,9897
151
152
  uncountable/integration/queue_runner/queue_runner.py,sha256=N4sUXmlGzVquybiJ7NQZavCJOBGrxBj6k7mb-TITaN0,1139
152
153
  uncountable/integration/queue_runner/types.py,sha256=8HS6KnYMS_vc5XHeMpg0BFAQC-5P3QLzd-aDYDMMt3E,244
153
- uncountable/integration/queue_runner/worker.py,sha256=YU1qRGCYF7vrEcsV4zGnNslYGc6XM9WMCpoATtXB_g0,7314
154
+ uncountable/integration/queue_runner/worker.py,sha256=mAA-NAxjMH3q1pooIbCzNBN6pIPAlSOn4eO1UITayeQ,7356
154
155
  uncountable/integration/queue_runner/command_server/__init__.py,sha256=hMCDLWct8zW4B2a9BaIAsMhtaEgFlxONjeow-6nf6dg,675
155
156
  uncountable/integration/queue_runner/command_server/command_client.py,sha256=Gb-BdCXa6YSSHHN-SbLvtcSf5CgDUJ3cUWQevmb1o4g,5682
156
157
  uncountable/integration/queue_runner/command_server/command_server.py,sha256=Q9tYkJXfjq1yNIUwDmHIDdX70HVOaTWtZLMDhWN5C0k,7867
@@ -384,7 +385,7 @@ uncountable/types/api/recipes/get_recipe_calculations.py,sha256=Nx00qf4rOfe8bNUN
384
385
  uncountable/types/api/recipes/get_recipe_links.py,sha256=ousQ2zrAmNg7rIxT4kwD5FlOmG0XMnVVPNFn3V7vePU,1484
385
386
  uncountable/types/api/recipes/get_recipe_names.py,sha256=rv3-Dv0gy_Ylo6c_irKco0GdKP5_QHHQdOh67qkSCMY,1511
386
387
  uncountable/types/api/recipes/get_recipe_output_metadata.py,sha256=IYm4DA7RN8gvxkhA5dfBInpH0h-TOGGrMpWwDmJbYsw,2045
387
- uncountable/types/api/recipes/get_recipes_data.py,sha256=-FIV2dOP1qAib4LoIKcn4mkdsC8EGKZdPZYO3p9HHQw,8670
388
+ uncountable/types/api/recipes/get_recipes_data.py,sha256=BKHOa2_oXzm-UP14czZSwS8crZqc1MXSzoKRdtT55Sg,8718
388
389
  uncountable/types/api/recipes/lock_recipes.py,sha256=Ez5oWRwq_n16RHli56uaEURGrRYxyIS2VLOJEUQ9kaY,1885
389
390
  uncountable/types/api/recipes/remove_recipe_from_project.py,sha256=h1I3cLUb_zZ3QjpK7IKPT_1gTDPTPbGWg0OJN_rUn6o,1186
390
391
  uncountable/types/api/recipes/set_recipe_inputs.py,sha256=2NhVAfkIjVTtUKeV1aPLb42wP6XZBerbYKJ_K_HH3kA,2040
@@ -408,7 +409,7 @@ uncountable/types/api/uploader/complete_async_parse.py,sha256=Os1HAubxTlbut6Gylj
408
409
  uncountable/types/api/uploader/invoke_uploader.py,sha256=QU1KmAFgGHSWskZEKfaAww8rCj-hVNP0i4kMQE3x3Fc,1822
409
410
  uncountable/types/api/user/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
410
411
  uncountable/types/api/user/get_current_user_info.py,sha256=BT7bGp5SOHz3XdKWhhdZ6acnInafT2PgdJ-H4YH3W7c,1181
411
- uncountablepythonsdk-0.0.173.dev2.dist-info/METADATA,sha256=Qsqk-cRXZaJOR1FhuzNn41TKnWaXrbAjJvbynm4IOQA,2237
412
- uncountablepythonsdk-0.0.173.dev2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
413
- uncountablepythonsdk-0.0.173.dev2.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
414
- uncountablepythonsdk-0.0.173.dev2.dist-info/RECORD,,
412
+ uncountablepythonsdk-0.0.175.dist-info/METADATA,sha256=8pwGUT8NIoJ_bP3Y6TAOUjk8LSX_pDlAotlZC6UB4h0,2172
413
+ uncountablepythonsdk-0.0.175.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
414
+ uncountablepythonsdk-0.0.175.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
415
+ uncountablepythonsdk-0.0.175.dist-info/RECORD,,