Skip to content

Commit

Permalink
fix python build
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Aug 11, 2024
1 parent a011ab1 commit 5f46cd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions vegafusion-python-embed/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod dataframe;
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use pyo3::types::{PyBytes, PyDict, PyList, PyTuple};
use std::borrow::Cow;
use std::collections::HashMap;
use std::sync::{Arc, Once};
use tokio::runtime::Runtime;
Expand Down Expand Up @@ -623,8 +624,8 @@ fn vegafusion_embed(_py: Python, m: &PyModule) -> PyResult<()> {
/// Helper function to parse an input Python string or dict as a ChartSpec
fn parse_json_spec(chart_spec: PyObject) -> PyResult<ChartSpec> {
Python::with_gil(|py| -> PyResult<ChartSpec> {
if let Ok(chart_spec) = chart_spec.extract::<&str>(py) {
match serde_json::from_str::<ChartSpec>(chart_spec) {
if let Ok(chart_spec) = chart_spec.extract::<Cow<str>>(py) {
match serde_json::from_str::<ChartSpec>(&chart_spec) {
Ok(chart_spec) => Ok(chart_spec),
Err(err) => Err(PyValueError::new_err(format!(
"Failed to parse chart_spec string as Vega: {err}"
Expand Down
2 changes: 1 addition & 1 deletion vegafusion-sql/src/connection/datafusion_py_datasource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl ExecutionPlan for PyDatasourceExec {
self.projected_schema.clone()
}

fn children(&self) -> Vec<Arc<dyn ExecutionPlan>> {
fn children(&self) -> Vec<&Arc<(dyn ExecutionPlan + 'static)>> {
Vec::new()
}

Expand Down

0 comments on commit 5f46cd1

Please sign in to comment.