milenkovicm commented on code in PR #1100:
URL:
https://github.com/apache/datafusion-ballista/pull/1100#discussion_r1835112002
##########
python/src/lib.rs:
##########
@@ -15,18 +15,59 @@
// specific language governing permissions and limitations
// under the License.
+use ballista::prelude::*;
+use datafusion::prelude::*;
+use datafusion_python::context::PySessionContext as
DataFusionPythonSessionContext;
+use datafusion_python::utils::wait_for_future;
+use std::collections::HashMap;
+
use pyo3::prelude::*;
-pub mod context;
mod utils;
-pub use crate::context::PySessionContext;
-
#[pymodule]
-fn pyballista_internal(_py: Python, m: Bound<'_, PyModule>) -> PyResult<()> {
+fn ballista_internal(_py: Python, m: Bound<'_, PyModule>) -> PyResult<()> {
pyo3_log::init();
// Ballista structs
- m.add_class::<PySessionContext>()?;
+ m.add_class::<PyBallista>()?;
// DataFusion structs
m.add_class::<datafusion_python::dataframe::PyDataFrame>()?;
Ok(())
}
+
+#[pyclass(name = "Ballista", module = "ballista", subclass)]
+pub struct PyBallista(pub Option<HashMap<String, String>>);
+
+#[pymethods]
+impl PyBallista {
+ #[staticmethod]
+ #[pyo3(signature = (config=None))]
+ pub fn config(config: Option<HashMap<String, String>>) -> Self {
Review Comment:
i dont see that `config` is wired with `SessionContext` creation, should it
be wired with it?
##########
docs/source/user-guide/python.md:
##########
@@ -103,14 +109,15 @@ The `explain` method can be used to show the logical and
physical query plans fo
The following example demonstrates creating arrays with PyArrow and then
creating a Ballista DataFrame.
```python
-import ballista
+from ballista import Ballista
import pyarrow
# an alias
+# TODO implement Functions
f = ballista.functions
# create a context
-ctx = ballista.BallistaContext("localhost", 50050)
+ctx = StandaloneBallista.build()
Review Comment:
this still shows in diff as `StandaloneBallista.build()`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]