Skip to content

Commit 1708872

Browse files
committed
refactor: remove unused extract_table_provider function to streamline code
1 parent 57ad70a commit 1708872

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/utils.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
// under the License.
1717

1818
use crate::{
19-
catalog::PyTable,
2019
common::data_type::PyScalarValue,
21-
dataframe::PyDataFrame,
2220
errors::{py_datafusion_err, PyDataFusionError, PyDataFusionResult},
23-
table::PyTableProvider,
2421
TokioRuntime,
2522
};
2623
use datafusion::{
@@ -144,28 +141,6 @@ pub(crate) fn table_provider_from_pycapsule(
144141
}
145142
}
146143

147-
pub(crate) fn extract_table_provider(
148-
py_obj: &Bound<PyAny>,
149-
) -> PyResult<Option<Arc<dyn TableProvider>>> {
150-
if let Ok(py_table) = py_obj.extract::<PyTable>() {
151-
return Ok(Some(py_table.table()));
152-
}
153-
154-
if let Ok(py_provider) = py_obj.extract::<PyTableProvider>() {
155-
return Ok(Some(py_provider.into_inner()));
156-
}
157-
158-
if py_obj.extract::<PyDataFrame>().is_ok() {
159-
return Err(PyDataFusionError::Common(EXPECTED_PROVIDER_MSG.to_string()).into());
160-
}
161-
162-
if let Some(provider) = table_provider_from_pycapsule(py_obj)? {
163-
return Ok(Some(provider));
164-
}
165-
166-
Ok(None)
167-
}
168-
169144
pub(crate) fn py_obj_to_scalar_value(py: Python, obj: PyObject) -> PyResult<ScalarValue> {
170145
// convert Python object to PyScalarValue to ScalarValue
171146

0 commit comments

Comments
 (0)