chalk-remote-call-python 1.8.2__tar.gz → 1.8.5__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 (66) hide show
  1. {chalk_remote_call_python-1.8.2/chalk_remote_call_python.egg-info → chalk_remote_call_python-1.8.5}/PKG-INFO +1 -1
  2. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/Cargo.lock +13 -0
  3. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/Cargo.toml +1 -1
  4. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/async_service.rs +6 -1
  5. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/coalesce.rs +5 -1
  6. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/lib.rs +5 -1
  7. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/python_bridge.rs +33 -9
  8. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/self_consumer.rs +18 -7
  9. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/service.rs +5 -1
  10. chalk_remote_call_python-1.8.5/chalk_remote_call/_version.py +1 -0
  11. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5/chalk_remote_call_python.egg-info}/PKG-INFO +1 -1
  12. chalk_remote_call_python-1.8.2/chalk_remote_call/_version.py +0 -1
  13. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/MANIFEST.in +0 -0
  14. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/README.md +0 -0
  15. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/Cargo.toml +0 -0
  16. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/Cargo.toml +0 -0
  17. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.auth.v1.rs +0 -0
  18. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.common.v1.rs +0 -0
  19. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.rs +0 -0
  20. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.tonic.rs +0 -0
  21. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.utils.v1.rs +0 -0
  22. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/descriptor.bin +0 -0
  23. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-proto/src/lib.rs +0 -0
  24. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/metrics.rs +0 -0
  25. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/chalk-remote-call-server/src/server.rs +0 -0
  26. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk-remote-call-rs/rust-toolchain.toml +0 -0
  27. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/__init__.py +0 -0
  28. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/__main__.py +0 -0
  29. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/__init__.py +0 -0
  30. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/__init__.py +0 -0
  31. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/auth/__init__.py +0 -0
  32. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/auth/v1/__init__.py +0 -0
  33. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2.py +0 -0
  34. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2_grpc.py +0 -0
  35. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/common/__init__.py +0 -0
  36. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/common/v1/__init__.py +0 -0
  37. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2.py +0 -0
  38. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2_grpc.py +0 -0
  39. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/runtime/__init__.py +0 -0
  40. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/runtime/v1/__init__.py +0 -0
  41. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2.py +0 -0
  42. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2_grpc.py +0 -0
  43. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/__init__.py +0 -0
  44. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/__init__.py +0 -0
  45. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2.py +0 -0
  46. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2_grpc.py +0 -0
  47. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2.py +0 -0
  48. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2_grpc.py +0 -0
  49. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2.py +0 -0
  50. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2_grpc.py +0 -0
  51. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/_native.pyi +0 -0
  52. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/arrow_utils.py +0 -0
  53. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/cli.py +0 -0
  54. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/handler_loader.py +0 -0
  55. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/input_transform.py +0 -0
  56. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/server.py +0 -0
  57. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/servicer.py +0 -0
  58. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call/tracing.py +0 -0
  59. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call_python.egg-info/SOURCES.txt +0 -0
  60. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call_python.egg-info/dependency_links.txt +0 -0
  61. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call_python.egg-info/entry_points.txt +0 -0
  62. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call_python.egg-info/requires.txt +0 -0
  63. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/chalk_remote_call_python.egg-info/top_level.txt +0 -0
  64. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/pyproject.toml +0 -0
  65. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/setup.cfg +0 -0
  66. {chalk_remote_call_python-1.8.2 → chalk_remote_call_python-1.8.5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalk-remote-call-python
3
- Version: 1.8.2
3
+ Version: 1.8.5
4
4
  Summary: Chalk remote call Python runtime interface client
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -3607,6 +3607,16 @@ dependencies = [
3607
3607
  "tracing-core",
3608
3608
  ]
3609
3609
 
3610
+ [[package]]
3611
+ name = "tracing-serde"
3612
+ version = "0.2.0"
3613
+ source = "registry+https://github.com/rust-lang/crates.io-index"
3614
+ checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1"
3615
+ dependencies = [
3616
+ "serde",
3617
+ "tracing-core",
3618
+ ]
3619
+
3610
3620
  [[package]]
3611
3621
  name = "tracing-subscriber"
3612
3622
  version = "0.3.23"
@@ -3617,12 +3627,15 @@ dependencies = [
3617
3627
  "nu-ansi-term",
3618
3628
  "once_cell",
3619
3629
  "regex-automata",
3630
+ "serde",
3631
+ "serde_json",
3620
3632
  "sharded-slab",
3621
3633
  "smallvec",
3622
3634
  "thread_local",
3623
3635
  "tracing",
3624
3636
  "tracing-core",
3625
3637
  "tracing-log",
3638
+ "tracing-serde",
3626
3639
  ]
3627
3640
 
3628
3641
  [[package]]
@@ -19,7 +19,7 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "signa
19
19
  tokio-stream = "0.1"
20
20
  arrow = { version = "54", default-features = false, features = ["ipc"] }
21
21
  tracing = "0.1"
22
- tracing-subscriber = { version = "0.3", features = ["env-filter"] }
22
+ tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
23
23
  bytes = "1"
24
24
  uuid = { version = "1", features = ["v4"] }
25
25
  dashmap = "5"
@@ -190,7 +190,12 @@ impl AsyncRemoteCallService for AsyncRemoteCallServiceImpl {
190
190
  Err(e) => {
191
191
  s.status = RemoteCallStatus::Failed;
192
192
  s.error = Some(e.to_string());
193
- error!(call_id = %id, error = %e, "async call failed");
193
+ error!(
194
+ call_id = %id,
195
+ exception.stacktrace = e.details(),
196
+ "async call failed: {}",
197
+ e.details()
198
+ );
194
199
  }
195
200
  }
196
201
  }
@@ -176,7 +176,11 @@ impl CoalescingQueue {
176
176
  }
177
177
  }
178
178
  Err(e) => {
179
- error!("Coalesced handler error: {}", e);
179
+ error!(
180
+ exception.stacktrace = e.details(),
181
+ "Coalesced handler error: {}",
182
+ e.details()
183
+ );
180
184
  // IPC decode errors are already caught by the service's
181
185
  // pre-validation; anything reaching here is a handler error.
182
186
  #[cfg(target_os = "linux")]
@@ -44,8 +44,12 @@ fn start_server(
44
44
  max_batching_size: usize,
45
45
  max_buffer_duration_ms: u64,
46
46
  ) -> PyResult<()> {
47
- // Initialize tracing (respects RUST_LOG env var, defaults to info)
47
+ // Kubernetes consumes stdout/stderr as a machine-readable log stream. Keep
48
+ // event fields flattened so collectors can read `level`, `target`,
49
+ // `message`, and fields such as `error` without parsing terminal output.
48
50
  let _ = tracing_subscriber::fmt()
51
+ .json()
52
+ .flatten_event(true)
49
53
  .with_env_filter(
50
54
  EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")),
51
55
  )
@@ -74,7 +74,7 @@ impl PythonHandler {
74
74
  })
75
75
  })
76
76
  .await
77
- .map_err(|e| PythonError(format!("Task join error: {e}")))?
77
+ .map_err(|e| PythonError::new(format!("Task join error: {e}")))?
78
78
  }
79
79
 
80
80
  /// Non-batched streaming dispatch. Calls `process_batches(..., emit)` so
@@ -147,7 +147,7 @@ impl PythonHandler {
147
147
  })
148
148
  })
149
149
  .await
150
- .map_err(|e| PythonError(format!("Task join error: {e}")))?
150
+ .map_err(|e| PythonError::new(format!("Task join error: {e}")))?
151
151
  }
152
152
  }
153
153
 
@@ -305,13 +305,13 @@ fn invoke_process_fn(
305
305
  let result_list: &Bound<'_, PyList> = result
306
306
  .bind(py)
307
307
  .cast::<PyList>()
308
- .map_err(|e| PythonError(format!("bridge must return a list, got: {e}")))?;
308
+ .map_err(|e| PythonError::new(format!("bridge must return a list, got: {e}")))?;
309
309
 
310
310
  let mut out = Vec::with_capacity(result_list.len());
311
311
  for item in result_list.iter() {
312
- let bytes_ref: &Bound<'_, PyBytes> = item
313
- .cast::<PyBytes>()
314
- .map_err(|e| PythonError(format!("bridge must return list[bytes], got item: {e}")))?;
312
+ let bytes_ref: &Bound<'_, PyBytes> = item.cast::<PyBytes>().map_err(|e| {
313
+ PythonError::new(format!("bridge must return list[bytes], got item: {e}"))
314
+ })?;
315
315
  out.push(bytes_ref.as_bytes().to_vec());
316
316
  }
317
317
  Ok(out)
@@ -319,14 +319,38 @@ fn invoke_process_fn(
319
319
 
320
320
  /// Error type for Python handler invocations.
321
321
  #[derive(Debug)]
322
- pub struct PythonError(pub String);
322
+ pub struct PythonError {
323
+ details: String,
324
+ }
325
+
326
+ impl PythonError {
327
+ fn new(message: String) -> Self {
328
+ Self { details: message }
329
+ }
330
+
331
+ pub fn details(&self) -> &str {
332
+ &self.details
333
+ }
334
+ }
323
335
 
324
336
  impl std::fmt::Display for PythonError {
325
337
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
326
- write!(f, "{}", self.0)
338
+ write!(f, "{}", self.details)
327
339
  }
328
340
  }
329
341
 
330
342
  fn into_python_error(py: Python<'_>, err: PyErr) -> PythonError {
331
- PythonError(format!("{}", err.value(py)))
343
+ let summary = err.to_string();
344
+ let details = format_python_traceback(py, &err).unwrap_or_else(|_| summary.clone());
345
+ PythonError { details }
346
+ }
347
+
348
+ fn format_python_traceback(py: Python<'_>, err: &PyErr) -> PyResult<String> {
349
+ let traceback = py.import("traceback")?;
350
+ let formatted = traceback.call_method1(
351
+ "format_exception",
352
+ (err.get_type(py), err.value(py), err.traceback(py)),
353
+ )?;
354
+ let lines: Vec<String> = formatted.extract()?;
355
+ Ok(lines.concat().trim_end().to_string())
332
356
  }
@@ -609,16 +609,27 @@ async fn execute_and_write(
609
609
  info!(call_id = %work.call_id, chunks = flushed, "queued call completed");
610
610
  }
611
611
  Err(e) => {
612
- // Parity with the enqueue/poll path: only a message string is
613
- // available (no structured exc_type / traceback yet), so exc_type is
614
- // a fixed placeholder.
615
- stream_writer::write_error(conn, &stream_key, seq, "RemoteFunctionError", &e.0, None)
616
- .await?;
617
- let summary: String = e.0.chars().take(200).collect();
612
+ // The formatted Python traceback is available, but the concrete
613
+ // exception type is not carried separately across this boundary.
614
+ stream_writer::write_error(
615
+ conn,
616
+ &stream_key,
617
+ seq,
618
+ "RemoteFunctionError",
619
+ e.details(),
620
+ None,
621
+ )
622
+ .await?;
623
+ let summary: String = e.to_string().chars().take(200).collect();
618
624
  let _ = queue
619
625
  .complete_status(call_uuid, "failed", &summary, Some(processing_trace_id))
620
626
  .await;
621
- error!(call_id = %work.call_id, error = %e, "queued call failed");
627
+ error!(
628
+ call_id = %work.call_id,
629
+ exception.stacktrace = e.details(),
630
+ "queued call failed: {}",
631
+ e.details()
632
+ );
622
633
  }
623
634
  }
624
635
  Ok(())
@@ -139,7 +139,11 @@ impl RemoteCallService for RemoteCallServiceImpl {
139
139
  // handler failure; nothing to send.
140
140
  debug!("client disconnected during streaming response");
141
141
  } else {
142
- error!("Python handler error: {}", e);
142
+ error!(
143
+ exception.stacktrace = e.details(),
144
+ "Python handler error: {}",
145
+ e.details()
146
+ );
143
147
  let _ = error_tx
144
148
  .send(Err(Status::unknown(format!(
145
149
  "Exception raised during handler execution: {e}"
@@ -0,0 +1 @@
1
+ __version__ = "1.8.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalk-remote-call-python
3
- Version: 1.8.2
3
+ Version: 1.8.5
4
4
  Summary: Chalk remote call Python runtime interface client
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -1 +0,0 @@
1
- __version__ = "1.8.2"