tbar4 commented on code in PR #1100:
URL: 
https://github.com/apache/datafusion-ballista/pull/1100#discussion_r1845811608


##########
python/src/lib.rs:
##########
@@ -15,18 +15,107 @@
 // specific language governing permissions and limitations
 // under the License.
 
+use ballista::prelude::*;
+use datafusion::execution::SessionStateBuilder;
+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;
+use utils::to_pyerr;
 
 #[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::<PyBallistaBuilder>()?;
     // DataFusion structs
     m.add_class::<datafusion_python::dataframe::PyDataFrame>()?;
+    // Ballista Config
+    /*
+    // Future implementation will include more state and config options
+    m.add_class::<PySessionStateBuilder>()?;
+    m.add_class::<PySessionState>()?;
+    m.add_class::<PySessionConfig>()?;
+    */
     Ok(())
 }
+
+// Ballista Builder will take a HasMap/Dict Cionfg
+#[pyclass(name = "BallistaBuilder", module = "ballista", subclass)]
+pub struct PyBallistaBuilder {
+    conf: HashMap<String, String>,
+}
+
+#[pymethods]
+impl PyBallistaBuilder {
+    #[new]
+    pub fn new() -> Self {
+        Self {
+            conf: HashMap::new(),
+        }
+    }
+
+    pub fn config(
+        mut slf: PyRefMut<'_, Self>,
+        k: &str,
+        v: &str,
+        py: Python,
+    ) -> PyResult<PyObject> {
+        slf.conf.insert(k.into(), v.into());
+
+        Ok(slf.into_py(py))
+    }
+
+    pub fn show_config(&self) {

Review Comment:
   removed, I was using it to validate config



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to