@@ -21,7 +21,7 @@ use pyo3::types::*;
2121use datafusion:: common:: ScalarValue ;
2222use datafusion:: config:: ConfigOptions ;
2323
24- use crate :: errors:: PyDataFusionError ;
24+ use crate :: errors:: PyDataFusionResult ;
2525
2626#[ pyclass( name = "Config" , module = "datafusion" , subclass) ]
2727#[ derive( Clone ) ]
@@ -40,9 +40,9 @@ impl PyConfig {
4040
4141 /// Get configurations from environment variables
4242 #[ staticmethod]
43- pub fn from_env ( ) -> PyResult < Self > {
43+ pub fn from_env ( ) -> PyDataFusionResult < Self > {
4444 Ok ( Self {
45- config : ConfigOptions :: from_env ( ) . map_err ( PyDataFusionError :: from ) ?,
45+ config : ConfigOptions :: from_env ( ) ?,
4646 } )
4747 }
4848
@@ -58,12 +58,10 @@ impl PyConfig {
5858 }
5959
6060 /// Set a configuration option
61- pub fn set ( & mut self , key : & str , value : PyObject , py : Python ) -> PyResult < ( ) > {
61+ pub fn set ( & mut self , key : & str , value : PyObject , py : Python ) -> PyDataFusionResult < ( ) > {
6262 let scalar_value = py_obj_to_scalar_value ( py, value) ;
63- self . config
64- . set ( key, scalar_value. to_string ( ) . as_str ( ) )
65- . map_err ( PyDataFusionError :: from)
66- . map_err ( PyErr :: from)
63+ self . config . set ( key, scalar_value. to_string ( ) . as_str ( ) ) ?;
64+ Ok ( ( ) )
6765 }
6866
6967 /// Get all configuration options
0 commit comments