chalk-remote-call-python 1.10.9__tar.gz → 1.10.10__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.
- {chalk_remote_call_python-1.10.9/chalk_remote_call_python.egg-info → chalk_remote_call_python-1.10.10}/PKG-INFO +13 -1
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/README.md +12 -0
- chalk_remote_call_python-1.10.10/chalk_remote_call/_version.py +1 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/servicer.py +25 -16
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10/chalk_remote_call_python.egg-info}/PKG-INFO +13 -1
- chalk_remote_call_python-1.10.9/chalk_remote_call/_version.py +0 -1
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/MANIFEST.in +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/Cargo.lock +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/Cargo.toml +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/Cargo.toml +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.auth.v1.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.common.v1.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.tonic.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.utils.v1.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/descriptor.bin +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-proto/src/lib.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/Cargo.toml +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/build.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/async_service.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/coalesce.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/fnq_client.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/lib.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/metrics.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/python_bridge.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/self_consumer.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/server.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/chalk-remote-call-server/src/service.rs +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/rust-toolchain.toml +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/__main__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/auth/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/auth/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/common/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/common/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/runtime/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/runtime/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/runtime/v1/fnq_consumer_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/runtime/v1/fnq_consumer_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/large_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/large_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_native.pyi +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/arrow_utils.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/cli.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/errors.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/handler_loader.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/input_transform.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/logging.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/server.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/tracing.py +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call_python.egg-info/SOURCES.txt +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call_python.egg-info/dependency_links.txt +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call_python.egg-info/entry_points.txt +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call_python.egg-info/requires.txt +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call_python.egg-info/top_level.txt +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/pyproject.toml +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/setup.cfg +0 -0
- {chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chalk-remote-call-python
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.10
|
|
4
4
|
Summary: Chalk remote call Python runtime interface client
|
|
5
5
|
Author: Chalk AI, Inc.
|
|
6
6
|
Project-URL: Homepage, https://chalk.ai
|
|
@@ -186,6 +186,18 @@ def handler(event, context):
|
|
|
186
186
|
serve(handler=handler, port=8080)
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
+
### Invocation context
|
|
190
|
+
|
|
191
|
+
Each Python bridge invocation runs in a fresh `contextvars.Context`. Handler
|
|
192
|
+
changes to context variables stay within that invocation, including across
|
|
193
|
+
awaits and generator iteration, and are discarded on return or error. Incoming
|
|
194
|
+
request metadata still supplies the tracing parent. A coalesced batch has one
|
|
195
|
+
invocation context for the whole batch.
|
|
196
|
+
|
|
197
|
+
Workers retain their Python thread state for compatibility with native
|
|
198
|
+
extensions. This context boundary does not reset process globals or
|
|
199
|
+
`threading.local()` storage, whose lifetime follows the worker thread.
|
|
200
|
+
|
|
189
201
|
## Local Testing
|
|
190
202
|
|
|
191
203
|
Use `grpcurl` to verify the server is running:
|
|
@@ -147,6 +147,18 @@ def handler(event, context):
|
|
|
147
147
|
serve(handler=handler, port=8080)
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
### Invocation context
|
|
151
|
+
|
|
152
|
+
Each Python bridge invocation runs in a fresh `contextvars.Context`. Handler
|
|
153
|
+
changes to context variables stay within that invocation, including across
|
|
154
|
+
awaits and generator iteration, and are discarded on return or error. Incoming
|
|
155
|
+
request metadata still supplies the tracing parent. A coalesced batch has one
|
|
156
|
+
invocation context for the whole batch.
|
|
157
|
+
|
|
158
|
+
Workers retain their Python thread state for compatibility with native
|
|
159
|
+
extensions. This context boundary does not reset process globals or
|
|
160
|
+
`threading.local()` storage, whose lifetime follows the worker thread.
|
|
161
|
+
|
|
150
162
|
## Local Testing
|
|
151
163
|
|
|
152
164
|
Use `grpcurl` to verify the server is running:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.10.10"
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/servicer.py
RENAMED
|
@@ -4,7 +4,9 @@ import asyncio
|
|
|
4
4
|
import dataclasses
|
|
5
5
|
import inspect
|
|
6
6
|
from collections.abc import Callable
|
|
7
|
-
from
|
|
7
|
+
from contextvars import Context
|
|
8
|
+
from functools import wraps
|
|
9
|
+
from typing import Any, ParamSpec, TypeVar
|
|
8
10
|
|
|
9
11
|
import pyarrow as pa
|
|
10
12
|
import pyarrow.ipc as ipc
|
|
@@ -13,6 +15,18 @@ from chalk_remote_call.arrow_utils import decode_ipc_stream, encode_record_batch
|
|
|
13
15
|
from chalk_remote_call.input_transform import resolve_column_names, transform
|
|
14
16
|
from chalk_remote_call.tracing import remote_function_invocation_span
|
|
15
17
|
|
|
18
|
+
_Params = ParamSpec("_Params")
|
|
19
|
+
_Result = TypeVar("_Result")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _isolated_context(function: Callable[_Params, _Result]) -> Callable[_Params, _Result]:
|
|
23
|
+
@wraps(function)
|
|
24
|
+
def invoke(*args: _Params.args, **kwargs: _Params.kwargs) -> _Result:
|
|
25
|
+
# Keep native thread state reusable while request ContextVars start empty.
|
|
26
|
+
return Context().run(function, *args, **kwargs)
|
|
27
|
+
|
|
28
|
+
return invoke
|
|
29
|
+
|
|
16
30
|
|
|
17
31
|
def _is_structured(obj: Any) -> bool:
|
|
18
32
|
"""Return True if *obj* is a recognised structured-type instance."""
|
|
@@ -124,27 +138,19 @@ def _coerce_to_record_batch(result: Any) -> pa.RecordBatch:
|
|
|
124
138
|
raise TypeError(f"Cannot convert handler result of type {type(result).__name__} to RecordBatch: {e}") from e
|
|
125
139
|
|
|
126
140
|
|
|
127
|
-
def
|
|
128
|
-
"""
|
|
141
|
+
def _run_async(coro):
|
|
142
|
+
"""Run a coroutine synchronously and close its owned event loop."""
|
|
129
143
|
try:
|
|
130
|
-
|
|
144
|
+
asyncio.get_running_loop()
|
|
131
145
|
except RuntimeError:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def _run_async(coro):
|
|
138
|
-
"""Run a coroutine synchronously."""
|
|
139
|
-
loop = _get_or_create_event_loop()
|
|
140
|
-
if loop.is_running():
|
|
141
|
-
# Already inside an async context — can't use run_until_complete.
|
|
142
|
-
# Create a new loop in a thread.
|
|
146
|
+
pass
|
|
147
|
+
else:
|
|
148
|
+
# A caller's running loop stays on its own thread and remains open.
|
|
143
149
|
import concurrent.futures
|
|
144
150
|
|
|
145
151
|
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool:
|
|
146
152
|
return pool.submit(asyncio.run, coro).result()
|
|
147
|
-
return
|
|
153
|
+
return asyncio.run(coro)
|
|
148
154
|
|
|
149
155
|
|
|
150
156
|
def _drain_async_gen(agen, emit: Callable[[bytes], None]) -> None:
|
|
@@ -157,6 +163,7 @@ def _drain_async_gen(agen, emit: Callable[[bytes], None]) -> None:
|
|
|
157
163
|
_run_async(_drain())
|
|
158
164
|
|
|
159
165
|
|
|
166
|
+
@_isolated_context
|
|
160
167
|
def process_batches(
|
|
161
168
|
ipc_bytes: bytes,
|
|
162
169
|
handler: Callable[..., Any],
|
|
@@ -210,6 +217,7 @@ def _concat_batches(batches: list[pa.RecordBatch]) -> pa.RecordBatch:
|
|
|
210
217
|
return pa.Table.from_batches(batches).combine_chunks().to_batches()[0]
|
|
211
218
|
|
|
212
219
|
|
|
220
|
+
@_isolated_context
|
|
213
221
|
def process_batches_coalesced(
|
|
214
222
|
items_ipc_bytes: list[bytes],
|
|
215
223
|
handler: Callable[..., Any],
|
|
@@ -292,6 +300,7 @@ def process_batches_coalesced(
|
|
|
292
300
|
return output
|
|
293
301
|
|
|
294
302
|
|
|
303
|
+
@_isolated_context
|
|
295
304
|
def process_batches_coalesced_combined(
|
|
296
305
|
items_ipc_bytes: list[bytes],
|
|
297
306
|
handler: Callable[..., Any],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chalk-remote-call-python
|
|
3
|
-
Version: 1.10.
|
|
3
|
+
Version: 1.10.10
|
|
4
4
|
Summary: Chalk remote call Python runtime interface client
|
|
5
5
|
Author: Chalk AI, Inc.
|
|
6
6
|
Project-URL: Homepage, https://chalk.ai
|
|
@@ -186,6 +186,18 @@ def handler(event, context):
|
|
|
186
186
|
serve(handler=handler, port=8080)
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
+
### Invocation context
|
|
190
|
+
|
|
191
|
+
Each Python bridge invocation runs in a fresh `contextvars.Context`. Handler
|
|
192
|
+
changes to context variables stay within that invocation, including across
|
|
193
|
+
awaits and generator iteration, and are discarded on return or error. Incoming
|
|
194
|
+
request metadata still supplies the tracing parent. A coalesced batch has one
|
|
195
|
+
invocation context for the whole batch.
|
|
196
|
+
|
|
197
|
+
Workers retain their Python thread state for compatibility with native
|
|
198
|
+
extensions. This context boundary does not reset process globals or
|
|
199
|
+
`threading.local()` storage, whose lifetime follows the worker thread.
|
|
200
|
+
|
|
189
201
|
## Local Testing
|
|
190
202
|
|
|
191
203
|
Use `grpcurl` to verify the server is running:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.10.9"
|
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/Cargo.lock
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk-remote-call-rs/Cargo.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/__init__.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/_native.pyi
RENAMED
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/cli.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/logging.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/server.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.9 → chalk_remote_call_python-1.10.10}/chalk_remote_call/tracing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|