calc-flow-python 2026.9.24__cp39-abi3-win_amd64.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.
- calc_flow/__init__.py +248 -0
- calc_flow/_compat.py +103 -0
- calc_flow/_native.pyd +4 -0
- calc_flow/_native.pyi +387 -0
- calc_flow/_stream_inputs.py +233 -0
- calc_flow/array.py +1337 -0
- calc_flow/asof_join_spec.py +126 -0
- calc_flow/capabilities.py +829 -0
- calc_flow/compute.py +278 -0
- calc_flow/config.py +221 -0
- calc_flow/errors.py +25 -0
- calc_flow/join_spec.py +157 -0
- calc_flow/pipeline.py +1288 -0
- calc_flow/py.typed +0 -0
- calc_flow/runtime.py +1075 -0
- calc_flow/store.py +140 -0
- calc_flow/stream.py +390 -0
- calc_flow/symbolic/__init__.py +69 -0
- calc_flow/symbolic/_generated_rolling_kernels.py +23 -0
- calc_flow/symbolic/analyzer.py +2788 -0
- calc_flow/symbolic/asof.py +212 -0
- calc_flow/symbolic/asof_analysis.py +215 -0
- calc_flow/symbolic/domains.py +77 -0
- calc_flow/symbolic/errors.py +67 -0
- calc_flow/symbolic/expr.py +850 -0
- calc_flow/symbolic/late_output.py +256 -0
- calc_flow/symbolic/lower/__init__.py +31 -0
- calc_flow/symbolic/lower/asof.py +86 -0
- calc_flow/symbolic/lower/bindings.py +69 -0
- calc_flow/symbolic/lower/event_windows.py +477 -0
- calc_flow/symbolic/lower/late_output.py +118 -0
- calc_flow/symbolic/lower/planners.py +1278 -0
- calc_flow/symbolic/lower/program.py +840 -0
- calc_flow/symbolic/lower/schema.py +170 -0
- calc_flow/symbolic/lower/segments.py +871 -0
- calc_flow/symbolic/lower/sql.py +423 -0
- calc_flow/symbolic/lower/strategies.py +1522 -0
- calc_flow/symbolic/nodes.py +626 -0
- calc_flow/symbolic/ops.py +1305 -0
- calc_flow/symbolic/optimizer.py +692 -0
- calc_flow/symbolic/program.py +494 -0
- calc_flow/symbolic/sql.py +36 -0
- calc_flow/symbolic/types.py +110 -0
- calc_flow/symbolic/windows.py +177 -0
- calc_flow/udf.py +19 -0
- calc_flow_python-2026.9.24.dist-info/METADATA +318 -0
- calc_flow_python-2026.9.24.dist-info/RECORD +50 -0
- calc_flow_python-2026.9.24.dist-info/WHEEL +4 -0
- calc_flow_python-2026.9.24.dist-info/licenses/LICENSE +202 -0
- calc_flow_python-2026.9.24.dist-info/sboms/calc-flow-python.cyclonedx.json +10082 -0
calc_flow/__init__.py
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from calc_flow import _native as _native
|
|
4
|
+
from calc_flow import symbolic
|
|
5
|
+
from calc_flow.array import register_jax, register_numpy
|
|
6
|
+
from calc_flow.asof_join_spec import AsofJoinSide, AsofJoinSpec, AsofStateLimits
|
|
7
|
+
from calc_flow.capabilities import (
|
|
8
|
+
CapabilityRule,
|
|
9
|
+
ConnectorCapabilities,
|
|
10
|
+
ConnectorCapability,
|
|
11
|
+
OperatorCapability,
|
|
12
|
+
ProviderArrayRules,
|
|
13
|
+
ProviderCapability,
|
|
14
|
+
ProviderOption,
|
|
15
|
+
ProviderOptionsSchema,
|
|
16
|
+
ProviderPort,
|
|
17
|
+
RuntimeCapabilities,
|
|
18
|
+
RuntimeSessionScope,
|
|
19
|
+
UdfCapability,
|
|
20
|
+
connector_capabilities,
|
|
21
|
+
)
|
|
22
|
+
from calc_flow.compute import compute, compute_async
|
|
23
|
+
from calc_flow.config import ProjectDocument
|
|
24
|
+
from calc_flow.errors import (
|
|
25
|
+
CalcFlowError,
|
|
26
|
+
CancelledError,
|
|
27
|
+
CheckpointError,
|
|
28
|
+
CheckpointPublicationUnknownError,
|
|
29
|
+
CompileError,
|
|
30
|
+
ConfigError,
|
|
31
|
+
ExecutionError,
|
|
32
|
+
ProviderError,
|
|
33
|
+
StreamingRuntimeError,
|
|
34
|
+
)
|
|
35
|
+
from calc_flow.pipeline import (
|
|
36
|
+
ArrowFieldSpec,
|
|
37
|
+
BatchExecutionPlan,
|
|
38
|
+
DeliveryGuarantee,
|
|
39
|
+
ExecutionPlan,
|
|
40
|
+
JoinStateLimits,
|
|
41
|
+
JoinTimeBounds,
|
|
42
|
+
PipelineBuilder,
|
|
43
|
+
Runtime,
|
|
44
|
+
StreamExecutionPlan,
|
|
45
|
+
StreamRequirements,
|
|
46
|
+
compile_stream_project,
|
|
47
|
+
project_json_schema,
|
|
48
|
+
validate_project_json,
|
|
49
|
+
)
|
|
50
|
+
from calc_flow.runtime import (
|
|
51
|
+
BoundedOutOfOrderness,
|
|
52
|
+
Cursor,
|
|
53
|
+
Data,
|
|
54
|
+
DisabledWatermarks,
|
|
55
|
+
EdgeBudget,
|
|
56
|
+
EpochIdempotentDelivery,
|
|
57
|
+
Idle,
|
|
58
|
+
JobOutcome,
|
|
59
|
+
JobStatus,
|
|
60
|
+
JSONValue,
|
|
61
|
+
ManagedCheckpointRuntime,
|
|
62
|
+
NativeWatermarkCapability,
|
|
63
|
+
OrdinaryDelivery,
|
|
64
|
+
ReplayPositioning,
|
|
65
|
+
RollingCallbackMetrics,
|
|
66
|
+
RollingMetrics,
|
|
67
|
+
SinkBinding,
|
|
68
|
+
SinkDelivery,
|
|
69
|
+
SinkRecovery,
|
|
70
|
+
SourceBinding,
|
|
71
|
+
SourceCapabilities,
|
|
72
|
+
SourceDeliveryCapability,
|
|
73
|
+
SourceEvent,
|
|
74
|
+
SourceProvidedWatermarks,
|
|
75
|
+
StreamingError,
|
|
76
|
+
StreamingFailureReasonCode,
|
|
77
|
+
StreamingJob,
|
|
78
|
+
StreamingRunner,
|
|
79
|
+
StreamRuntimeConfig,
|
|
80
|
+
StreamSink,
|
|
81
|
+
StreamSource,
|
|
82
|
+
TransactionalDelivery,
|
|
83
|
+
TransactionalStreamSink,
|
|
84
|
+
Watermark,
|
|
85
|
+
WatermarkPolicy,
|
|
86
|
+
)
|
|
87
|
+
from calc_flow.store import FileProjectStore
|
|
88
|
+
from calc_flow.stream import StreamInput, StreamOutput, StreamResults
|
|
89
|
+
from calc_flow.symbolic import (
|
|
90
|
+
AnalysisIssue,
|
|
91
|
+
AnalysisResult,
|
|
92
|
+
ArrayExpr,
|
|
93
|
+
ColumnExpr,
|
|
94
|
+
CrossSectionGroup,
|
|
95
|
+
DurationFrame,
|
|
96
|
+
EventTimeBucket,
|
|
97
|
+
Expr,
|
|
98
|
+
FeatureSet,
|
|
99
|
+
Field,
|
|
100
|
+
LateOutputs,
|
|
101
|
+
Parameter,
|
|
102
|
+
Program,
|
|
103
|
+
RowFrame,
|
|
104
|
+
TableExpr,
|
|
105
|
+
WindowAggregate,
|
|
106
|
+
cs,
|
|
107
|
+
duration,
|
|
108
|
+
event_time_bucket,
|
|
109
|
+
exact_time,
|
|
110
|
+
linalg,
|
|
111
|
+
lit,
|
|
112
|
+
parameter,
|
|
113
|
+
row,
|
|
114
|
+
rows,
|
|
115
|
+
sql,
|
|
116
|
+
table,
|
|
117
|
+
table_input,
|
|
118
|
+
ts,
|
|
119
|
+
window,
|
|
120
|
+
with_late_output,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
__version__ = "2026.9.24"
|
|
124
|
+
Batch = _native.Batch
|
|
125
|
+
ExecutionOptions = _native.ExecutionOptions
|
|
126
|
+
ProviderContext = _native.ProviderContext
|
|
127
|
+
RunResult = _native.RunResult
|
|
128
|
+
__all__ = [
|
|
129
|
+
"AsofJoinSide",
|
|
130
|
+
"AsofJoinSpec",
|
|
131
|
+
"AsofStateLimits",
|
|
132
|
+
"compute",
|
|
133
|
+
"compute_async",
|
|
134
|
+
"sql",
|
|
135
|
+
"StreamInput",
|
|
136
|
+
"StreamOutput",
|
|
137
|
+
"StreamResults",
|
|
138
|
+
"Expr",
|
|
139
|
+
"ColumnExpr",
|
|
140
|
+
"TableExpr",
|
|
141
|
+
"ArrayExpr",
|
|
142
|
+
"LateOutputs",
|
|
143
|
+
"with_late_output",
|
|
144
|
+
"Parameter",
|
|
145
|
+
"Field",
|
|
146
|
+
"FeatureSet",
|
|
147
|
+
"Program",
|
|
148
|
+
"table_input",
|
|
149
|
+
"parameter",
|
|
150
|
+
"lit",
|
|
151
|
+
"row",
|
|
152
|
+
"ts",
|
|
153
|
+
"cs",
|
|
154
|
+
"table",
|
|
155
|
+
"linalg",
|
|
156
|
+
"window",
|
|
157
|
+
"rows",
|
|
158
|
+
"duration",
|
|
159
|
+
"exact_time",
|
|
160
|
+
"event_time_bucket",
|
|
161
|
+
"RowFrame",
|
|
162
|
+
"DurationFrame",
|
|
163
|
+
"CrossSectionGroup",
|
|
164
|
+
"EventTimeBucket",
|
|
165
|
+
"WindowAggregate",
|
|
166
|
+
"AnalysisIssue",
|
|
167
|
+
"AnalysisResult",
|
|
168
|
+
"Batch",
|
|
169
|
+
"ArrowFieldSpec",
|
|
170
|
+
"BatchExecutionPlan",
|
|
171
|
+
"BoundedOutOfOrderness",
|
|
172
|
+
"CalcFlowError",
|
|
173
|
+
"CancelledError",
|
|
174
|
+
"CheckpointError",
|
|
175
|
+
"CheckpointPublicationUnknownError",
|
|
176
|
+
"CompileError",
|
|
177
|
+
"ConfigError",
|
|
178
|
+
"Cursor",
|
|
179
|
+
"Data",
|
|
180
|
+
"DisabledWatermarks",
|
|
181
|
+
"EdgeBudget",
|
|
182
|
+
"EpochIdempotentDelivery",
|
|
183
|
+
"ExecutionError",
|
|
184
|
+
"ExecutionOptions",
|
|
185
|
+
"DeliveryGuarantee",
|
|
186
|
+
"FileProjectStore",
|
|
187
|
+
"Idle",
|
|
188
|
+
"JobOutcome",
|
|
189
|
+
"JobStatus",
|
|
190
|
+
"RollingCallbackMetrics",
|
|
191
|
+
"RollingMetrics",
|
|
192
|
+
"JSONValue",
|
|
193
|
+
"JoinStateLimits",
|
|
194
|
+
"JoinTimeBounds",
|
|
195
|
+
"ManagedCheckpointRuntime",
|
|
196
|
+
"NativeWatermarkCapability",
|
|
197
|
+
"OrdinaryDelivery",
|
|
198
|
+
"ProviderError",
|
|
199
|
+
"ProviderContext",
|
|
200
|
+
"ProjectDocument",
|
|
201
|
+
"ExecutionPlan",
|
|
202
|
+
"PipelineBuilder",
|
|
203
|
+
"ConnectorCapabilities",
|
|
204
|
+
"ConnectorCapability",
|
|
205
|
+
"CapabilityRule",
|
|
206
|
+
"OperatorCapability",
|
|
207
|
+
"connector_capabilities",
|
|
208
|
+
"compile_stream_project",
|
|
209
|
+
"ProviderArrayRules",
|
|
210
|
+
"ProviderCapability",
|
|
211
|
+
"ProviderOption",
|
|
212
|
+
"ProviderOptionsSchema",
|
|
213
|
+
"ProviderPort",
|
|
214
|
+
"Runtime",
|
|
215
|
+
"RuntimeCapabilities",
|
|
216
|
+
"RuntimeSessionScope",
|
|
217
|
+
"RunResult",
|
|
218
|
+
"ReplayPositioning",
|
|
219
|
+
"SinkBinding",
|
|
220
|
+
"SinkDelivery",
|
|
221
|
+
"SinkRecovery",
|
|
222
|
+
"SourceBinding",
|
|
223
|
+
"SourceCapabilities",
|
|
224
|
+
"SourceDeliveryCapability",
|
|
225
|
+
"SourceEvent",
|
|
226
|
+
"SourceProvidedWatermarks",
|
|
227
|
+
"StreamRuntimeConfig",
|
|
228
|
+
"StreamSink",
|
|
229
|
+
"StreamSource",
|
|
230
|
+
"StreamingError",
|
|
231
|
+
"StreamingFailureReasonCode",
|
|
232
|
+
"StreamingJob",
|
|
233
|
+
"StreamingRunner",
|
|
234
|
+
"StreamingRuntimeError",
|
|
235
|
+
"StreamExecutionPlan",
|
|
236
|
+
"StreamRequirements",
|
|
237
|
+
"TransactionalDelivery",
|
|
238
|
+
"TransactionalStreamSink",
|
|
239
|
+
"UdfCapability",
|
|
240
|
+
"register_jax",
|
|
241
|
+
"register_numpy",
|
|
242
|
+
"symbolic",
|
|
243
|
+
"project_json_schema",
|
|
244
|
+
"validate_project_json",
|
|
245
|
+
"Watermark",
|
|
246
|
+
"WatermarkPolicy",
|
|
247
|
+
"__version__",
|
|
248
|
+
]
|
calc_flow/_compat.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""Python-version support for slotted frozen data containers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
from builtins import zip as _builtin_zip
|
|
7
|
+
from dataclasses import dataclass as _stdlib_dataclass
|
|
8
|
+
from dataclasses import fields
|
|
9
|
+
from enum import Enum
|
|
10
|
+
from itertools import zip_longest
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
if sys.version_info >= (3, 12):
|
|
14
|
+
from typing import TypeAliasType as TypeAliasType
|
|
15
|
+
else:
|
|
16
|
+
from typing_extensions import TypeAliasType as TypeAliasType
|
|
17
|
+
|
|
18
|
+
if sys.version_info >= (3, 10):
|
|
19
|
+
dataclass = _stdlib_dataclass
|
|
20
|
+
else:
|
|
21
|
+
|
|
22
|
+
def _inherited_slots(cls: type) -> set[str]:
|
|
23
|
+
return {
|
|
24
|
+
name
|
|
25
|
+
for base in cls.__mro__[1:]
|
|
26
|
+
for name in (
|
|
27
|
+
(base.__slots__,)
|
|
28
|
+
if isinstance(getattr(base, "__slots__", ()), str)
|
|
29
|
+
else getattr(base, "__slots__", ())
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
def _install_frozen_pickle(slotted: type, namespace: dict[str, Any]) -> None:
|
|
34
|
+
def getstate(self: object) -> list[object]:
|
|
35
|
+
return [getattr(self, item.name) for item in fields(self)]
|
|
36
|
+
|
|
37
|
+
def setstate(self: object, values: list[object]) -> None:
|
|
38
|
+
for item, value in zip(fields(self), values):
|
|
39
|
+
object.__setattr__(self, item.name, value)
|
|
40
|
+
|
|
41
|
+
if "__getstate__" not in namespace:
|
|
42
|
+
slotted.__getstate__ = getstate
|
|
43
|
+
if "__setstate__" not in namespace:
|
|
44
|
+
slotted.__setstate__ = setstate
|
|
45
|
+
|
|
46
|
+
def _slotted_dataclass(result: type, *, frozen: bool) -> type:
|
|
47
|
+
if "__slots__" in result.__dict__:
|
|
48
|
+
raise TypeError(f"{result.__name__} already specifies __slots__")
|
|
49
|
+
|
|
50
|
+
names = tuple(item.name for item in fields(result))
|
|
51
|
+
inherited = _inherited_slots(result)
|
|
52
|
+
namespace = dict(result.__dict__)
|
|
53
|
+
namespace["__slots__"] = tuple(name for name in names if name not in inherited)
|
|
54
|
+
for name in names:
|
|
55
|
+
namespace.pop(name, None)
|
|
56
|
+
namespace.pop("__dict__", None)
|
|
57
|
+
namespace.pop("__weakref__", None)
|
|
58
|
+
slotted = type(result)(result.__name__, result.__bases__, namespace)
|
|
59
|
+
slotted.__qualname__ = result.__qualname__
|
|
60
|
+
if frozen:
|
|
61
|
+
_install_frozen_pickle(slotted, namespace)
|
|
62
|
+
return slotted
|
|
63
|
+
|
|
64
|
+
def dataclass(*, slots: bool = False, **options: Any) -> Any:
|
|
65
|
+
"""Build stdlib data classes with slots on Python 3.9."""
|
|
66
|
+
|
|
67
|
+
def decorate(cls: type) -> type:
|
|
68
|
+
result = _stdlib_dataclass(cls, **options)
|
|
69
|
+
if slots:
|
|
70
|
+
return _slotted_dataclass(result, frozen=bool(options.get("frozen")))
|
|
71
|
+
return result
|
|
72
|
+
|
|
73
|
+
return decorate
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
if sys.version_info >= (3, 11):
|
|
77
|
+
from enum import StrEnum as StrEnum
|
|
78
|
+
else:
|
|
79
|
+
|
|
80
|
+
class StrEnum(str, Enum):
|
|
81
|
+
"""String-valued enum with the standard string representation."""
|
|
82
|
+
|
|
83
|
+
__str__ = str.__str__
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
if sys.version_info >= (3, 10):
|
|
87
|
+
zip = _builtin_zip
|
|
88
|
+
else:
|
|
89
|
+
|
|
90
|
+
def zip(*iterables: Any, strict: bool = False) -> Any:
|
|
91
|
+
"""Preserve strict zip validation on Python 3.9."""
|
|
92
|
+
if not strict:
|
|
93
|
+
return _builtin_zip(*iterables)
|
|
94
|
+
|
|
95
|
+
sentinel = object()
|
|
96
|
+
|
|
97
|
+
def rows() -> Any:
|
|
98
|
+
for values in zip_longest(*iterables, fillvalue=sentinel):
|
|
99
|
+
if any(value is sentinel for value in values):
|
|
100
|
+
raise ValueError("zip() arguments have different lengths")
|
|
101
|
+
yield values
|
|
102
|
+
|
|
103
|
+
return rows()
|
calc_flow/_native.pyd
ADDED