@@ -89,31 +89,17 @@ pub(crate) fn validate_pycapsule(capsule: &Bound<PyCapsule>, name: &str) -> PyRe
89
89
90
90
Ok ( ( ) )
91
91
}
92
- /// Convert a Python object to ScalarValue using PyArrow
92
+ /// Convert a Python object to ScalarValue
93
93
///
94
94
/// Args:
95
95
/// py: Python interpreter
96
96
/// obj: Python object to convert
97
97
///
98
98
/// Returns:
99
99
/// 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.
103
100
pub ( 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) ) )<
8000
/span>;
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
115
102
116
- // For datetime and other complex types, convert via PyArrow
117
103
let pa = py. import ( "pyarrow" ) ?;
118
104
119
105
// Convert Python object to PyArrow scalar
0 commit comments