houqp commented on a change in pull request #873: URL: https://github.com/apache/arrow-datafusion/pull/873#discussion_r738949791
########## File path: python/src/lib.rs ########## @@ -17,42 +17,45 @@ use pyo3::prelude::*; +mod catalog; mod context; mod dataframe; mod errors; mod expression; mod functions; -mod scalar; -mod to_py; -mod to_rust; -mod types; mod udaf; mod udf; +// TODO(kszucs): remvoe // taken from https://github.com/PyO3/pyo3/issues/471 -fn register_module_package(py: Python, package_name: &str, module: &PyModule) { - py.import("sys") - .expect("failed to import python sys module") - .dict() - .get_item("modules") - .expect("failed to get python modules dictionary") - .downcast::<pyo3::types::PyDict>() - .expect("failed to turn sys.modules into a PyDict") - .set_item(package_name, module) - .expect("failed to inject module"); -} +// fn register_module_package(py: Python, package_name: &str, module: &PyModule) { +// py.import("sys") +// .expect("failed to import python sys module") +// .dict() +// .get_item("modules") +// .expect("failed to get python modules dictionary") +// .downcast::<pyo3::types::PyDict>() +// .expect("failed to turn sys.modules into a PyDict") +// .set_item(package_name, module) +// .expect("failed to inject module"); +// } /// DataFusion. #[pymodule] -fn datafusion(py: Python, m: &PyModule) -> PyResult<()> { - m.add_class::<context::ExecutionContext>()?; - m.add_class::<dataframe::DataFrame>()?; - m.add_class::<expression::Expression>()?; +fn internals(py: Python, m: &PyModule) -> PyResult<()> { + expression::init(m)?; + + //register_module_package(py, "datafusion.functions", functions); Review comment: My bad, should have added a test case :) Implementing it in Python also works if you prefer that route instead :+1: -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
