tensorzero icon indicating copy to clipboard operation
tensorzero copied to clipboard

Make Python native module initialization more robust

Open Aaron1011 opened this issue 6 months ago • 1 comments

We should eagerly import everything that we need, and decide exactly what error should be thrown if we encounter a Rust error inside the #[pymodule] initializer.

Aaron1011 avatar Jun 13 '25 21:06 Aaron1011

Hi, could you please explain in more detail what changes or improvements you're looking for regarding making the Python native module initialization more robust? Specifically, what do you mean by 'eagerly import everything' and what kind of errors should we handle in the #[pymodule] initializer?

Tekalig avatar Jun 14 '25 07:06 Tekalig

Done in https://github.com/tensorzero/tensorzero/pull/2487

@Tekalig This issue was about making sure that we have our Python error classes loaded very early during our native module initialization, so that we know that we can throw them if anything goes wrong during initialization.

Aaron1011 avatar Jun 17 '25 14:06 Aaron1011