You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/02 20:01:42 UTC
[GitHub] [arrow-datafusion-python] andygrove opened a new pull request, #115: Upgrade to latest DataFusion
andygrove opened a new pull request, #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] andygrove commented on a diff in pull request #115: Upgrade to latest DataFusion
Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#discussion_r1060180273
##########
src/dataframe.rs:
##########
@@ -38,8 +38,8 @@ pub(crate) struct PyDataFrame {
impl PyDataFrame {
/// creates a new PyDataFrame
- pub fn new(df: Arc<DataFrame>) -> Self {
- Self { df }
+ pub fn new(df: DataFrame) -> Self {
+ Self { df: Arc::new(df) }
Review Comment:
Pyo3 methods require `&self` and cannot take `self`, so my solution was to introduce an `Arc` here.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] jdye64 commented on pull request #115: Upgrade to DataFusion 16.0.0
Posted by GitBox <gi...@apache.org>.
jdye64 commented on PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#issuecomment-1396118042
@andygrove given that the remaining test failures preventing this PR from getting merged all all related to `window` logic, and it seems window logic bindings in general need some work, would it be fair to just comment out those failing tests as part of this upgrade to unblock other work? From there we can introduce the window bindings and un-comment the tests once that is complete. Otherwise I fear this PR is going to grow unwieldy if we try to introduce those bindings in this PR as well. Thoughts?
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] andygrove commented on a diff in pull request #115: Upgrade to latest DataFusion
Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#discussion_r1067345116
##########
src/functions.rs:
##########
@@ -87,26 +88,27 @@ fn window(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PyExpr>>,
) -> PyResult<PyExpr> {
- use std::str::FromStr;
- let fun = datafusion_expr::window_function::WindowFunction::from_str(name)
- .map_err(|e| -> errors::DataFusionError { e.into() })?;
- Ok(PyExpr {
- expr: datafusion_expr::Expr::WindowFunction {
- fun,
- args: args.into_iter().map(|x| x.expr).collect::<Vec<_>>(),
- partition_by: partition_by
- .unwrap_or_default()
- .into_iter()
- .map(|x| x.expr)
- .collect::<Vec<_>>(),
- order_by: order_by
- .unwrap_or_default()
- .into_iter()
- .map(|x| x.expr)
- .collect::<Vec<_>>(),
- window_frame: None,
- },
- })
+ // TODO
+ todo!()
+ // let fun = find_df_window_func(name).unwrap();
+ // //.ok_or_else(errors::DataFusionError { e.into() })?;
+ // Ok(PyExpr {
+ // expr: datafusion_expr::Expr::WindowFunction(WindowFunction {
+ // fun,
+ // args: args.into_iter().map(|x| x.expr).collect::<Vec<_>>(),
+ // partition_by: partition_by
+ // .unwrap_or_default()
+ // .into_iter()
+ // .map(|x| x.expr)
+ // .collect::<Vec<_>>(),
+ // order_by: order_by
+ // .unwrap_or_default()
+ // .into_iter()
+ // .map(|x| x.expr)
+ // .collect::<Vec<_>>(),
+ // window_frame: None,
Review Comment:
We now need to provide a WindowFrame here, and I am not familiar enough with window support to know what to do here without some research. I wonder if anyone can help me with this? @francis-du @Jimexist ?
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] andygrove commented on pull request #115: Upgrade to DataFusion 16.0.0
Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#issuecomment-1396233523
@francis-du fyi
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] jdye64 commented on pull request #115: Upgrade to DataFusion 16.0.0
Posted by GitBox <gi...@apache.org>.
jdye64 commented on PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#issuecomment-1396315054
LGTM. That was a bear. Thanks for tackling it.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] jdye64 commented on pull request #115: Upgrade to DataFusion 16.0.0
Posted by GitBox <gi...@apache.org>.
jdye64 commented on PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#issuecomment-1396127683
Actually I see that `config.rs` also needs some refactoring and updating. That also seems like a heavy fix for this PR however.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] andygrove commented on pull request #115: Upgrade to DataFusion 16.0.0
Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#issuecomment-1396228300
@jdye64 I have now fixed all the regressions.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] andygrove merged pull request #115: Upgrade to DataFusion 16.0.0
Posted by GitBox <gi...@apache.org>.
andygrove merged PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion-python] andygrove commented on a diff in pull request #115: Upgrade to latest DataFusion
Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #115:
URL: https://github.com/apache/arrow-datafusion-python/pull/115#discussion_r1060180171
##########
src/context.rs:
##########
@@ -348,12 +348,16 @@ impl PySessionContext {
.ok_or_else(|| PyValueError::new_err("Unable to convert path to a string"))?;
let mut options = NdJsonReadOptions::default()
.table_partition_cols(convert_table_partition_cols(table_partition_cols)?);
- options.schema = schema.map(|s| Arc::new(s.0));
options.schema_infer_max_records = schema_infer_max_records;
options.file_extension = file_extension;
-
- let result = self.ctx.read_json(path, options);
- let df = wait_for_future(py, result).map_err(DataFusionError::from)?;
+ let df = if let Some(schema) = schema {
+ options.schema = Some(&schema.0);
+ let result = self.ctx.read_json(path, options);
+ wait_for_future(py, result).map_err(DataFusionError::from)?
+ } else {
+ let result = self.ctx.read_json(path, options);
+ wait_for_future(py, result).map_err(DataFusionError::from)?
+ };
Review Comment:
This was necessary because `options.schema` holds a reference to a schema now so we need to wait for the future to complete before ownership can be released.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org