chalkruntime 3.35.0__tar.gz → 3.35.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 (112) hide show
  1. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/PKG-INFO +1 -1
  2. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/convert_chalkpy_underscore.py +6 -0
  3. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/feature.py +6 -1
  4. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/underscore_operation_registry.py +48 -4
  5. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime.egg-info/PKG-INFO +1 -1
  6. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/pyproject.toml +1 -1
  7. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/README.md +0 -0
  8. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/__init__.py +0 -0
  9. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/constants.py +0 -0
  10. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/dataframe/__init__.py +0 -0
  11. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/dataframe/dataframe.py +0 -0
  12. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/dataframe/lazyframe.py +0 -0
  13. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/exc/__init__.py +0 -0
  14. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/exc/failed_argument.py +0 -0
  15. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/exc/resolver_errors.py +0 -0
  16. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/exc/wrapped_resolver_exception.py +0 -0
  17. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/__init__.py +0 -0
  18. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/chalk_overload.py +0 -0
  19. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/filter_conversion.py +0 -0
  20. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/global_graph.py +0 -0
  21. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/graph.py +0 -0
  22. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/graph_impl.py +0 -0
  23. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/graph_proxy.py +0 -0
  24. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/graph_state.py +0 -0
  25. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/jinja_parser.py +0 -0
  26. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/materializations.py +0 -0
  27. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/maybe_named_collection.py +0 -0
  28. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/named_query.py +0 -0
  29. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/nearest_neighbor.py +0 -0
  30. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/overlay_graph.py +0 -0
  31. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/prompt_service.py +0 -0
  32. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/protograph_deserializer.py +0 -0
  33. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/protograph_serializer.py +0 -0
  34. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/resolver.py +0 -0
  35. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/singletons.py +0 -0
  36. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/sklearn_model_parser.py +0 -0
  37. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/stream_resolver.py +0 -0
  38. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/underscore.py +0 -0
  39. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/underscore_codec_info.py +0 -0
  40. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/graph/variables.py +0 -0
  41. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/heaptrack_launcher.py +0 -0
  42. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/incrementalization/__init__.py +0 -0
  43. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/incrementalization/group_incrementalizer.py +0 -0
  44. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/incrementalization/incrementalizer.py +0 -0
  45. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/__init__.py +0 -0
  46. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/batch_result_collector.py +0 -0
  47. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/bound_invoker.py +0 -0
  48. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/bound_invoker_cache.py +0 -0
  49. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/general_bound_invoker.py +0 -0
  50. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/no_arg_scalar_invoker.py +0 -0
  51. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/one_to_one_invoker.py +0 -0
  52. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/overlay_features.py +0 -0
  53. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/parse_external_resolver.py +0 -0
  54. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/partition_batch.py +0 -0
  55. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/query_execution_parameters.py +0 -0
  56. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_args_builder.py +0 -0
  57. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_input.py +0 -0
  58. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_input_upload.py +0 -0
  59. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_output_metadata.py +0 -0
  60. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_raw_output_parsing.py +0 -0
  61. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_result.py +0 -0
  62. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/resolver_runner.py +0 -0
  63. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/sample.py +0 -0
  64. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/validator.py +0 -0
  65. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/invoker/vectorized_hasmany_sampler.py +0 -0
  66. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/loader/__init__.py +0 -0
  67. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/loader/converter.py +0 -0
  68. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/loader/importer.py +0 -0
  69. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/memray_launcher.py +0 -0
  70. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/metadata.py +0 -0
  71. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/py.typed +0 -0
  72. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/__init__.py +0 -0
  73. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/branch_model_endpoint_config.py +0 -0
  74. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/config.py +0 -0
  75. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/entrypoint.py +0 -0
  76. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/env_helper.py +0 -0
  77. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/remote_python_function_registry_client.py +0 -0
  78. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/server/service.py +0 -0
  79. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/__init__.py +0 -0
  80. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/composed_rewriter.py +0 -0
  81. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/contextual_query_rewriter.py +0 -0
  82. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/filter_query_rewriter.py +0 -0
  83. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/identity_rewriter.py +0 -0
  84. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/query_rewriter.py +0 -0
  85. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/sql_rewriter/query_rewriter_helper.py +0 -0
  86. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/__init__.py +0 -0
  87. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/converter_utils.py +0 -0
  88. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/exc.py +0 -0
  89. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/message_parsing.py +0 -0
  90. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/resolver_utils.py +0 -0
  91. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/streaming_invoker_kernel/__init__.py +0 -0
  92. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/streaming_invoker_kernel/local_streaming_invoker_kernel.py +0 -0
  93. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/types.py +0 -0
  94. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/streaming/window_keys.py +0 -0
  95. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/__init__.py +0 -0
  96. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/async_helpers.py +0 -0
  97. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/contextvars.py +0 -0
  98. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/datadog.py +0 -0
  99. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/internal_pl_utils.py +0 -0
  100. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/posix_file_lock.py +0 -0
  101. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/tracing.py +0 -0
  102. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/utils/viztracer_profiling.py +0 -0
  103. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime/valgrind_launcher.py +0 -0
  104. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime.egg-info/SOURCES.txt +0 -0
  105. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime.egg-info/dependency_links.txt +0 -0
  106. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime.egg-info/requires.txt +0 -0
  107. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/chalkruntime.egg-info/top_level.txt +0 -0
  108. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/setup.cfg +0 -0
  109. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/setup.py +0 -0
  110. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/tests/test_branch_model_endpoint_config.py +0 -0
  111. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/tests/test_graph_cache.py +0 -0
  112. {chalkruntime-3.35.0 → chalkruntime-3.35.2}/tests/test_posix_file_lock.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalkruntime
3
- Version: 3.35.0
3
+ Version: 3.35.2
4
4
  Summary: Runtime support library for Chalk AI
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -2493,12 +2493,15 @@ def _convert_underscore_expression(
2493
2493
  # Create an operation expression for catalog_call
2494
2494
  operands = MaybeNamedCollectionBuilder(positional_items=parsed_args)
2495
2495
 
2496
+ policies = getattr(underscore, "_chalk__policies", None) or []
2497
+
2496
2498
  operation = UnderscoreOperationRegistry.resolve(
2497
2499
  "catalog_call",
2498
2500
  frozendict(
2499
2501
  {
2500
2502
  "qualified_name": qualified_name,
2501
2503
  "output_type": output_dtype,
2504
+ "policies": policies,
2502
2505
  }
2503
2506
  ),
2504
2507
  )
@@ -2536,12 +2539,15 @@ def _convert_underscore_expression(
2536
2539
 
2537
2540
  operands = MaybeNamedCollectionBuilder(positional_items=parsed_args)
2538
2541
 
2542
+ policies = getattr(underscore, "_chalk__policies", None) or []
2543
+
2539
2544
  operation = UnderscoreOperationRegistry.resolve(
2540
2545
  "call_resolver",
2541
2546
  frozendict(
2542
2547
  {
2543
2548
  "resolver_fqn": resolver_fqn_arg,
2544
2549
  "output_type": output_type_arg,
2550
+ "policies": policies,
2545
2551
  }
2546
2552
  ),
2547
2553
  )
@@ -1402,7 +1402,12 @@ class WindowedFeatureType(_CompatibleWithNestedFeatureTypeMixin, NamedFeatureTyp
1402
1402
  pseudos = []
1403
1403
  for w in self.windows:
1404
1404
  name = get_name_with_duration(self.fqn, w)
1405
- f = self.graph.fqn_to_feature[name]
1405
+ # Some windows only exist for a specific version (e.g. a "90d" bucket added in v2
1406
+ # won't have a bare pseudo-feature for the v1 root). Skip missing entries rather
1407
+ # than raising KeyError.
1408
+ f = self.graph.fqn_to_feature.get(name)
1409
+ if f is None:
1410
+ continue
1406
1411
  assert isinstance(f, ScalarFeatureType)
1407
1412
  pseudos.append(f)
1408
1413
  return pseudos
@@ -1,4 +1,6 @@
1
- from typing import Any, Sequence, Type
1
+ import json
2
+ from collections.abc import Mapping, Sequence
3
+ from typing import Any, Type, cast
2
4
 
3
5
  import pyarrow as pa
4
6
  import pyarrow.compute as pc
@@ -8,6 +10,40 @@ from chalkruntime.graph.underscore import UnderscoreOperation
8
10
  from chalkruntime.graph.underscore_codec_info import FromPythonRegCodecInfo
9
11
 
10
12
 
13
+ def _blocking_policies_from_params(fn_name: str, params: frozendict[str, object]) -> list[dict[str, Any]]:
14
+ policies_json = params.get("policies_json")
15
+ if policies_json is not None:
16
+ if not isinstance(policies_json, str):
17
+ raise ValueError(
18
+ f"UnderscoreOperationRegistry: while resolving '{fn_name}', expect parameter policies_json to be of type {str} but instead got {policies_json} of type {type(policies_json).__name__}"
19
+ )
20
+ policies = json.loads(policies_json)
21
+ else:
22
+ policies = params.get("policies", [])
23
+
24
+ if policies is None:
25
+ return []
26
+ if not isinstance(policies, Sequence) or isinstance(policies, (str, bytes)):
27
+ raise ValueError(
28
+ f"UnderscoreOperationRegistry: while resolving '{fn_name}', expect parameter policies to be of type {Sequence} but instead got {policies} of type {type(policies).__name__}"
29
+ )
30
+
31
+ normalized: list[dict[str, Any]] = []
32
+ for i, policy in enumerate(policies):
33
+ if not isinstance(policy, Mapping):
34
+ raise ValueError(
35
+ f"UnderscoreOperationRegistry: while resolving '{fn_name}', expect policies[{i}] to be a mapping but got {policy} of type {type(policy).__name__}"
36
+ )
37
+ normalized.append(dict(cast(Mapping[str, Any], policy)))
38
+ return normalized
39
+
40
+
41
+ def _policy_codec_params(policies: list[dict[str, Any]]) -> dict[str, str]:
42
+ if not policies:
43
+ return {}
44
+ return {"policies_json": json.dumps(policies, sort_keys=True, separators=(",", ":"))}
45
+
46
+
11
47
  class UnderscoreOperationRegistry:
12
48
  @staticmethod
13
49
  def resolve(function_name: str, params: frozendict[str, object]):
@@ -123,11 +159,13 @@ class UnderscoreOperationRegistry:
123
159
  ),
124
160
  )
125
161
 
162
+ struct_fields: list[pa.Field] = [
163
+ pa.field(cast(str, name), cast(pa.DataType, type_val)) for name, type_val in zip(names, types)
164
+ ]
165
+
126
166
  return UnderscoreOperation(
127
167
  operation_name="struct_pack",
128
- return_type=lambda _: pa.struct(
129
- {name: type for name, type in zip(names, types)} # ty: ignore[invalid-argument-type]
130
- ),
168
+ return_type=lambda _: pa.struct(struct_fields),
131
169
  fn=_struct_pack_python_op,
132
170
  codec_info=codec_info,
133
171
  )
@@ -212,12 +250,15 @@ class UnderscoreOperationRegistry:
212
250
  )
213
251
  )
214
252
 
253
+ policies = _blocking_policies_from_params("catalog_call", params)
254
+
215
255
  codec_info = FromPythonRegCodecInfo(
216
256
  function_name="catalog_call",
217
257
  params=frozendict(
218
258
  {
219
259
  "qualified_name": qualified_name,
220
260
  "output_type": output_type,
261
+ **_policy_codec_params(policies),
221
262
  }
222
263
  ),
223
264
  )
@@ -263,12 +304,15 @@ class UnderscoreOperationRegistry:
263
304
  )
264
305
  )
265
306
 
307
+ policies = _blocking_policies_from_params("call_resolver", params)
308
+
266
309
  codec_info = FromPythonRegCodecInfo(
267
310
  function_name="call_resolver",
268
311
  params=frozendict(
269
312
  {
270
313
  "resolver_fqn": resolver_fqn,
271
314
  "output_type": output_type,
315
+ **_policy_codec_params(policies),
272
316
  }
273
317
  ),
274
318
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalkruntime
3
- Version: 3.35.0
3
+ Version: 3.35.2
4
4
  Summary: Runtime support library for Chalk AI
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -42,7 +42,7 @@ name = "chalkruntime"
42
42
  description = "Runtime support library for Chalk AI"
43
43
  readme = "README.md"
44
44
  requires-python = ">=3.10"
45
- version = "3.35.0"
45
+ version = "3.35.2"
46
46
 
47
47
 
48
48
  [tool.deptry]
File without changes
File without changes
File without changes