chalkruntime 3.32.1__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 (105) hide show
  1. chalkruntime-3.32.1/PKG-INFO +47 -0
  2. chalkruntime-3.32.1/README.md +7 -0
  3. chalkruntime-3.32.1/chalkruntime/__init__.py +0 -0
  4. chalkruntime-3.32.1/chalkruntime/constants.py +48 -0
  5. chalkruntime-3.32.1/chalkruntime/dataframe/__init__.py +4 -0
  6. chalkruntime-3.32.1/chalkruntime/dataframe/dataframe.py +18 -0
  7. chalkruntime-3.32.1/chalkruntime/dataframe/lazyframe.py +7 -0
  8. chalkruntime-3.32.1/chalkruntime/exc/__init__.py +0 -0
  9. chalkruntime-3.32.1/chalkruntime/exc/failed_argument.py +7 -0
  10. chalkruntime-3.32.1/chalkruntime/exc/resolver_errors.py +546 -0
  11. chalkruntime-3.32.1/chalkruntime/exc/wrapped_resolver_exception.py +5 -0
  12. chalkruntime-3.32.1/chalkruntime/graph/__init__.py +0 -0
  13. chalkruntime-3.32.1/chalkruntime/graph/chalk_overload.py +25 -0
  14. chalkruntime-3.32.1/chalkruntime/graph/convert_chalkpy_underscore.py +1961 -0
  15. chalkruntime-3.32.1/chalkruntime/graph/feature.py +3611 -0
  16. chalkruntime-3.32.1/chalkruntime/graph/filter_conversion.py +296 -0
  17. chalkruntime-3.32.1/chalkruntime/graph/global_graph.py +16 -0
  18. chalkruntime-3.32.1/chalkruntime/graph/graph.py +285 -0
  19. chalkruntime-3.32.1/chalkruntime/graph/graph_impl.py +932 -0
  20. chalkruntime-3.32.1/chalkruntime/graph/graph_proxy.py +117 -0
  21. chalkruntime-3.32.1/chalkruntime/graph/graph_state.py +81 -0
  22. chalkruntime-3.32.1/chalkruntime/graph/jinja_parser.py +235 -0
  23. chalkruntime-3.32.1/chalkruntime/graph/materializations.py +263 -0
  24. chalkruntime-3.32.1/chalkruntime/graph/maybe_named_collection.py +101 -0
  25. chalkruntime-3.32.1/chalkruntime/graph/named_query.py +160 -0
  26. chalkruntime-3.32.1/chalkruntime/graph/nearest_neighbor.py +106 -0
  27. chalkruntime-3.32.1/chalkruntime/graph/overlay_graph.py +155 -0
  28. chalkruntime-3.32.1/chalkruntime/graph/prompt_service.py +9 -0
  29. chalkruntime-3.32.1/chalkruntime/graph/protograph_deserializer.py +2367 -0
  30. chalkruntime-3.32.1/chalkruntime/graph/protograph_serializer.py +202 -0
  31. chalkruntime-3.32.1/chalkruntime/graph/resolver.py +905 -0
  32. chalkruntime-3.32.1/chalkruntime/graph/singletons.py +257 -0
  33. chalkruntime-3.32.1/chalkruntime/graph/sklearn_model_parser.py +240 -0
  34. chalkruntime-3.32.1/chalkruntime/graph/stream_resolver.py +410 -0
  35. chalkruntime-3.32.1/chalkruntime/graph/underscore.py +1600 -0
  36. chalkruntime-3.32.1/chalkruntime/graph/underscore_codec_info.py +59 -0
  37. chalkruntime-3.32.1/chalkruntime/graph/underscore_operation_registry.py +285 -0
  38. chalkruntime-3.32.1/chalkruntime/graph/variables.py +75 -0
  39. chalkruntime-3.32.1/chalkruntime/heaptrack_launcher.py +40 -0
  40. chalkruntime-3.32.1/chalkruntime/incrementalization/__init__.py +0 -0
  41. chalkruntime-3.32.1/chalkruntime/incrementalization/group_incrementalizer.py +61 -0
  42. chalkruntime-3.32.1/chalkruntime/incrementalization/incrementalizer.py +269 -0
  43. chalkruntime-3.32.1/chalkruntime/invoker/__init__.py +0 -0
  44. chalkruntime-3.32.1/chalkruntime/invoker/batch_result_collector.py +1058 -0
  45. chalkruntime-3.32.1/chalkruntime/invoker/bound_invoker.py +108 -0
  46. chalkruntime-3.32.1/chalkruntime/invoker/bound_invoker_cache.py +156 -0
  47. chalkruntime-3.32.1/chalkruntime/invoker/general_bound_invoker.py +1037 -0
  48. chalkruntime-3.32.1/chalkruntime/invoker/no_arg_scalar_invoker.py +202 -0
  49. chalkruntime-3.32.1/chalkruntime/invoker/one_to_one_invoker.py +1022 -0
  50. chalkruntime-3.32.1/chalkruntime/invoker/overlay_features.py +307 -0
  51. chalkruntime-3.32.1/chalkruntime/invoker/parse_external_resolver.py +221 -0
  52. chalkruntime-3.32.1/chalkruntime/invoker/partition_batch.py +184 -0
  53. chalkruntime-3.32.1/chalkruntime/invoker/query_execution_parameters.py +76 -0
  54. chalkruntime-3.32.1/chalkruntime/invoker/resolver_args_builder.py +283 -0
  55. chalkruntime-3.32.1/chalkruntime/invoker/resolver_input.py +139 -0
  56. chalkruntime-3.32.1/chalkruntime/invoker/resolver_input_upload.py +195 -0
  57. chalkruntime-3.32.1/chalkruntime/invoker/resolver_output_metadata.py +261 -0
  58. chalkruntime-3.32.1/chalkruntime/invoker/resolver_raw_output_parsing.py +407 -0
  59. chalkruntime-3.32.1/chalkruntime/invoker/resolver_result.py +51 -0
  60. chalkruntime-3.32.1/chalkruntime/invoker/resolver_runner.py +764 -0
  61. chalkruntime-3.32.1/chalkruntime/invoker/sample.py +425 -0
  62. chalkruntime-3.32.1/chalkruntime/invoker/validator.py +281 -0
  63. chalkruntime-3.32.1/chalkruntime/invoker/vectorized_hasmany_sampler.py +1534 -0
  64. chalkruntime-3.32.1/chalkruntime/loader/__init__.py +0 -0
  65. chalkruntime-3.32.1/chalkruntime/loader/converter.py +1616 -0
  66. chalkruntime-3.32.1/chalkruntime/loader/importer.py +234 -0
  67. chalkruntime-3.32.1/chalkruntime/memray_launcher.py +31 -0
  68. chalkruntime-3.32.1/chalkruntime/metadata.py +286 -0
  69. chalkruntime-3.32.1/chalkruntime/py.typed +0 -0
  70. chalkruntime-3.32.1/chalkruntime/server/__init__.py +0 -0
  71. chalkruntime-3.32.1/chalkruntime/server/config.py +189 -0
  72. chalkruntime-3.32.1/chalkruntime/server/entrypoint.py +793 -0
  73. chalkruntime-3.32.1/chalkruntime/server/env_helper.py +81 -0
  74. chalkruntime-3.32.1/chalkruntime/server/remote_python_function_registry_client.py +87 -0
  75. chalkruntime-3.32.1/chalkruntime/server/service.py +465 -0
  76. chalkruntime-3.32.1/chalkruntime/sql_rewriter/__init__.py +0 -0
  77. chalkruntime-3.32.1/chalkruntime/sql_rewriter/composed_rewriter.py +14 -0
  78. chalkruntime-3.32.1/chalkruntime/sql_rewriter/contextual_query_rewriter.py +101 -0
  79. chalkruntime-3.32.1/chalkruntime/sql_rewriter/filter_query_rewriter.py +1170 -0
  80. chalkruntime-3.32.1/chalkruntime/sql_rewriter/identity_rewriter.py +19 -0
  81. chalkruntime-3.32.1/chalkruntime/sql_rewriter/query_rewriter.py +11 -0
  82. chalkruntime-3.32.1/chalkruntime/sql_rewriter/query_rewriter_helper.py +207 -0
  83. chalkruntime-3.32.1/chalkruntime/streaming/__init__.py +0 -0
  84. chalkruntime-3.32.1/chalkruntime/streaming/converter_utils.py +54 -0
  85. chalkruntime-3.32.1/chalkruntime/streaming/exc.py +14 -0
  86. chalkruntime-3.32.1/chalkruntime/streaming/message_parsing.py +601 -0
  87. chalkruntime-3.32.1/chalkruntime/streaming/resolver_utils.py +63 -0
  88. chalkruntime-3.32.1/chalkruntime/streaming/types.py +237 -0
  89. chalkruntime-3.32.1/chalkruntime/streaming/window_keys.py +9 -0
  90. chalkruntime-3.32.1/chalkruntime/utils/__init__.py +0 -0
  91. chalkruntime-3.32.1/chalkruntime/utils/async_helpers.py +63 -0
  92. chalkruntime-3.32.1/chalkruntime/utils/contextvars.py +14 -0
  93. chalkruntime-3.32.1/chalkruntime/utils/datadog.py +44 -0
  94. chalkruntime-3.32.1/chalkruntime/utils/internal_pl_utils.py +146 -0
  95. chalkruntime-3.32.1/chalkruntime/utils/tracing.py +171 -0
  96. chalkruntime-3.32.1/chalkruntime/utils/viztracer_profiling.py +174 -0
  97. chalkruntime-3.32.1/chalkruntime/valgrind_launcher.py +43 -0
  98. chalkruntime-3.32.1/chalkruntime.egg-info/PKG-INFO +47 -0
  99. chalkruntime-3.32.1/chalkruntime.egg-info/SOURCES.txt +136 -0
  100. chalkruntime-3.32.1/chalkruntime.egg-info/dependency_links.txt +1 -0
  101. chalkruntime-3.32.1/chalkruntime.egg-info/requires.txt +33 -0
  102. chalkruntime-3.32.1/chalkruntime.egg-info/top_level.txt +4 -0
  103. chalkruntime-3.32.1/pyproject.toml +166 -0
  104. chalkruntime-3.32.1/setup.cfg +4 -0
  105. chalkruntime-3.32.1/setup.py +6 -0
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: chalkruntime
3
+ Version: 3.32.1
4
+ Summary: Runtime support library for Chalk AI
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: aiotools>=1.7.0
8
+ Requires-Dist: boto3>=1.34.131
9
+ Requires-Dist: datadog==0.47.0
10
+ Requires-Dist: filelock>=3.12.4
11
+ Requires-Dist: frozendict>=2.3.9
12
+ Requires-Dist: fsspec>=2024.9.0
13
+ Requires-Dist: gcsfs>=2024.9.0.post1
14
+ Requires-Dist: adlfs>=2024.7.0
15
+ Requires-Dist: google-cloud-storage>=2.18.2
16
+ Requires-Dist: jinja2>=3.0.0
17
+ Requires-Dist: numpy>=1.26.0
18
+ Requires-Dist: pandas>=1.5.3
19
+ Requires-Dist: pdb_attach>=3.0.1
20
+ Requires-Dist: polars>=0.19.12
21
+ Requires-Dist: pyarrow>=18.1.0
22
+ Requires-Dist: pydantic<2.0
23
+ Requires-Dist: s3fs>=2024.9.0
24
+ Requires-Dist: sqlalchemy<2
25
+ Requires-Dist: sqlglot<21.2.0,>=19.0.0
26
+ Requires-Dist: typing_extensions>=4.12.2
27
+ Requires-Dist: uvloop>=0.20.0
28
+ Requires-Dist: opentelemetry-api>=1.38.0
29
+ Requires-Dist: opentelemetry-sdk>=1.38.0
30
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.39.1
31
+ Requires-Dist: opentelemetry-distro[otlp]>=0.60b1
32
+ Requires-Dist: opentelemetry-instrumentation-fastapi>=0.59b0
33
+ Requires-Dist: opentelemetry-instrumentation-requests>=0.59b0
34
+ Requires-Dist: opentelemetry-instrumentation-httpx>=0.59b0
35
+ Requires-Dist: opentelemetry-instrumentation-pymongo>=0.59b0
36
+ Requires-Dist: opentelemetry-instrumentation-pymysql>=0.59b0
37
+ Requires-Dist: opentelemetry-instrumentation-psycopg2>=0.59b0
38
+ Requires-Dist: memray>=1.19.1
39
+ Requires-Dist: viztracer>=1.0.0
40
+
41
+ # chalkruntime
42
+
43
+ Runtime support library used by Chalk AI's execution engine.
44
+
45
+ This package is an internal component of the Chalk platform and is not intended
46
+ to be consumed as a standalone library. See https://chalk.ai for more
47
+ information.
@@ -0,0 +1,7 @@
1
+ # chalkruntime
2
+
3
+ Runtime support library used by Chalk AI's execution engine.
4
+
5
+ This package is an internal component of the Chalk platform and is not intended
6
+ to be consumed as a standalone library. See https://chalk.ai for more
7
+ information.
File without changes
@@ -0,0 +1,48 @@
1
+ from datetime import datetime, timedelta, timezone
2
+
3
+ import pyarrow as pa
4
+
5
+ ID_FEATURE_COL_NAME = "__id__"
6
+ TS_COL_NAME = "__ts__"
7
+ TS_COL_TYPE = pa.timestamp("us", "UTC")
8
+
9
+ PRESENCE_INDICATOR_COL_NAME = "__present__"
10
+
11
+ INDEX_COL_NAME = "__index__"
12
+ INDEX_COL_TYPE = pa.int64()
13
+ """The type of the `INDEX_COL_NAME` column."""
14
+
15
+ CHILD_INDEX_COL_NAME = "__cidx__"
16
+ OBSERVED_AT_FEATURE_COL_NAME = "__oat__"
17
+ REPLACED_OBSERVED_AT_FEATURE_COL_NAME = "__rat__"
18
+ SAMPLE_COL_NAME = "__sample__"
19
+ IS_VALID_COL_NAME = "__is_valid__"
20
+ RESOLVER_INPUT_PREFIX = "__CHALK_RESOLVER_INPUT__"
21
+
22
+ HAS_MANY_SAMPLE_COL_NAME = "__hm_sample__"
23
+ # Appears in the groups table of a has-many returning scalar resolver, equals __id__ of the input
24
+
25
+ ONLINE_STORE_TTL_COL_NAME = "__exp__"
26
+
27
+ CHALK_SPECIAL_COL_NAMES = (
28
+ ID_FEATURE_COL_NAME,
29
+ TS_COL_NAME,
30
+ INDEX_COL_NAME,
31
+ CHILD_INDEX_COL_NAME,
32
+ OBSERVED_AT_FEATURE_COL_NAME,
33
+ REPLACED_OBSERVED_AT_FEATURE_COL_NAME,
34
+ SAMPLE_COL_NAME,
35
+ IS_VALID_COL_NAME,
36
+ HAS_MANY_SAMPLE_COL_NAME,
37
+ ONLINE_STORE_TTL_COL_NAME,
38
+ )
39
+
40
+ INTERNAL_TTL_MAX = timedelta(days=365 * 10)
41
+ CLOSE_TO_MIN_UTC = datetime.min.replace(tzinfo=timezone.utc) + timedelta(days=10)
42
+
43
+ COUNT_COL_NAME = "__count__"
44
+ MAX_OBSERVED_AT_COL_NAME = "__max_observed_at__"
45
+
46
+
47
+ class SpecialResolverFQN:
48
+ CHALK_QUERY_INPUT = "__chalk__.query-input"
@@ -0,0 +1,4 @@
1
+ from .dataframe import ChalkDataFrame, chalk_dataframe_debug_context
2
+ from .lazyframe import LazyFrame
3
+
4
+ __all__ = ["ChalkDataFrame", "LazyFrame", "chalk_dataframe_debug_context"]
@@ -0,0 +1,18 @@
1
+ """Compatibility shims for the legacy ``chalkruntime.dataframe`` package.
2
+
3
+ This module used to host the engine-facing ``ChalkDataFrame`` type before we
4
+ introduced the standalone ``chalkdf`` package. Some parts of the codebase (and
5
+ older integrations) still import ``chalkruntime.dataframe.dataframe`` directly,
6
+ so we keep a very small wrapper that simply forwards those imports to the new
7
+ implementation. Keeping this bridge avoids having to update every existing
8
+ import site while the migration is in flight.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ from chalkdf import DataFrame as _DataFrame
14
+ from chalkdf.debug import chalk_dataframe_debug_context
15
+
16
+ ChalkDataFrame = _DataFrame
17
+
18
+ __all__ = ["ChalkDataFrame", "chalk_dataframe_debug_context"]
@@ -0,0 +1,7 @@
1
+ """Compatibility shim for ``chalkruntime.dataframe.lazyframe`` imports."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from chalkdf import LazyFrame
6
+
7
+ __all__ = ["LazyFrame"]
File without changes
@@ -0,0 +1,7 @@
1
+ import dataclasses
2
+
3
+
4
+ @dataclasses.dataclass(slots=True, frozen=True)
5
+ class FailedArgument:
6
+ expected_feature: str
7
+ value: object