kylebarron commented on code in PR #1000:
URL: 
https://github.com/apache/datafusion-python/pull/1000#discussion_r1932699499


##########
src/config.rs:
##########
@@ -40,7 +42,7 @@ impl PyConfig {
     #[staticmethod]
     pub fn from_env() -> PyResult<Self> {

Review Comment:
   Instead of always calling `map_err` to a `PyDataFusionError` and then 
coercing to `PyResult`, you can just return a `PyDataFusionResult` (i.e. 
`Result<T, PyDataFusionError>`). You just need to implement 
`From<PyDataFusionError> for PyErr`. 
https://github.com/developmentseed/obstore/blob/25f51361d8bf0634e8fe851b76d086ab0d23d0af/pyo3-object_store/src/error.rs#L102



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