jsai28 commented on code in PR #1060:
URL: 
https://github.com/apache/datafusion-python/pull/1060#discussion_r1992095923


##########
src/context.rs:
##########
@@ -308,7 +308,7 @@ impl PySessionContext {
 
     #[classmethod]
     #[pyo3(signature = ())]
-    fn _global_ctx(_cls: &Bound<'_, PyType>) -> PyResult<Self> {
+    fn global_ctx(_cls: &Bound<'_, PyType>) -> PyResult<Self> {

Review Comment:
   Thanks for your comments, just to summarize whats needed here:
   
   1. Expose the global context (`_global_ctx` -> `global_ctx`), which I've 
currently done.
   2. A python wrapper should be created for the global context (in the 
`SessionContext` class) which calls the above function and wraps it in 
`SessionContext` so that users can still use the other associated methods in 
this class, but with the global context. This should  be a class method so that 
users dont have to instantiate `SessionContext` first.
   3. The `read_*` functions (`read_parquet`, etc) should use the global 
context from this python wrapper instead of using the one from the internal 
implementation.
   
   Am I interpreting this correctly? Sorry if I'm overthinking this 😅. I've 
updated the PR, currently the `test_read_csv` and `test_read_csv_list` tests 
fail so I'm looking into that.



-- 
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