diff --git a/benchmarking/tpcds/ray_entrypoint.py b/benchmarking/tpcds/ray_entrypoint.py index a24ebca370..10e52c4198 100644 --- a/benchmarking/tpcds/ray_entrypoint.py +++ b/benchmarking/tpcds/ray_entrypoint.py @@ -1,5 +1,4 @@ import argparse -import sys from pathlib import Path import helpers @@ -17,12 +16,9 @@ def run( with open(query_file) as f: query = f.read() - try: - daft.sql(query, catalog=catalog).explain(show_all=True) - if not dry_run: - daft.sql(query, catalog=catalog).collect() - except Exception as e: - print(str(e), file=sys.stderr) + daft.sql(query, catalog=catalog).explain(show_all=True) + if not dry_run: + daft.sql(query, catalog=catalog).collect() if __name__ == "__main__": diff --git a/src/common/py-serde/src/python.rs b/src/common/py-serde/src/python.rs index 10e467e931..79e590bec3 100644 --- a/src/common/py-serde/src/python.rs +++ b/src/common/py-serde/src/python.rs @@ -84,8 +84,9 @@ macro_rules! impl_bincode_py_state_serialization { py: Python<'py>, ) -> PyResult<(PyObject, (pyo3::Bound<'py, pyo3::types::PyBytes>,))> { use pyo3::{ + exceptions::PyRuntimeError, types::{PyAnyMethods, PyBytes}, - PyTypeInfo, ToPyObject, + PyErr, PyTypeInfo, ToPyObject, }; Ok(( Self::type_object_bound(py) @@ -93,7 +94,12 @@ macro_rules! impl_bincode_py_state_serialization { .into(), (PyBytes::new_bound( py, - &$crate::bincode::serialize(&self).unwrap(), + &$crate::bincode::serialize(&self).map_err(|error| { + PyErr::new::(format!( + "Failed to serialize: {}", + error.to_string() + )) + })?, ),), )) }