-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce to_variant trait function to LogicalNode and create Explain LogicalNode bindings * Cargo fmt * bindings for Extension LogicalNode * Add missing classes to list of exports so test_imports will pass * Update to point to proper repo * Update pytest to adhere to aggregate calls being wrapped in projections * Address linter change which causes a pytest to fail
- Loading branch information
Showing
9 changed files
with
228 additions
and
134 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
use datafusion_expr::Extension; | ||
use pyo3::prelude::*; | ||
|
||
use crate::sql::logical::PyLogicalPlan; | ||
|
||
use super::logical_node::LogicalNode; | ||
|
||
#[pyclass(name = "Extension", module = "datafusion.expr", subclass)] | ||
#[derive(Clone)] | ||
pub struct PyExtension { | ||
pub node: Extension, | ||
} | ||
|
||
impl From<Extension> for PyExtension { | ||
fn from(node: Extension) -> PyExtension { | ||
PyExtension { node } | ||
} | ||
} | ||
|
||
#[pymethods] | ||
impl PyExtension { | ||
fn name(&self) -> PyResult<String> { | ||
Ok(self.node.node.name().to_string()) | ||
} | ||
} | ||
|
||
impl LogicalNode for PyExtension { | ||
fn inputs(&self) -> Vec<PyLogicalPlan> { | ||
vec![] | ||
} | ||
|
||
fn to_variant(&self, py: Python) -> PyResult<PyObject> { | ||
Ok(self.clone().into_py(py)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters