@@ -89,31 +89,17 @@ pub(crate) fn validate_pycapsule(capsule: &Bound<PyCapsule>, name: &str) -> PyRe
8989
9090 Ok ( ( ) )
9191}
92- /// Convert a Python object to ScalarValue using PyArrow
92+ /// Convert a Python object to ScalarValue
9393///
9494/// Args:
9595/// py: Python interpreter
9696/// obj: Python object to convert
9797///
9898/// Returns:
9999/// Result containing ScalarValue representation of the Python object
100- ///
101- /// This function handles basic Python types directly and uses PyArrow
102- /// for complex types like datetime.
103100pub ( crate ) fn py_obj_to_scalar_value ( py : Python , obj : PyObject ) -> PyResult < ScalarValue > {
104- if let Ok ( value) = obj. extract :: < bool > ( py) {
105- return Ok ( ScalarValue :: Boolean ( Some ( value) ) ) ;
106- } else if let Ok ( value) = obj. extract :: < i64 > ( py) {
107- return Ok ( ScalarValue :: Int64 ( Some ( value) ) ) ;
108- } else if let Ok ( value) = obj. extract :: < u64 > ( py) {
109- return Ok ( ScalarValue :: UInt64 ( Some ( value) ) ) ;
110- } else if let Ok ( value) = obj. extract :: < f64 > ( py) {
111- return Ok ( ScalarValue :: Float64 ( Some ( value) ) ) ;
112- } else if let Ok ( value) = obj. extract :: < String > ( py) {
113- return Ok ( ScalarValue :: Utf8 ( Some ( value) ) ) ;
114- }
101+ // convert Python object to PyScalarValue to ScalarValue
115102
116- // For datetime and other complex types, convert via PyArrow
117103 let pa = py. import ( "pyarrow" ) ?;
118104
119105 // Convert Python object to PyArrow scalar
0 commit comments