Skip to content

Commit

Permalink
Fix compiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Aug 10, 2024
1 parent 338aaa8 commit bb6e542
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions vegafusion-sql/src/dataframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,17 +1135,16 @@ impl SqlDataFrame {
groupby: &[String],
order_field: Option<&str>,
) -> Result<Arc<dyn DataFrame>> {
let (_, field_field) = self
.schema()
let schema = self.schema(); // Store the schema in a variable
let (_, field_field) = schema
.column_with_name(field)
.with_context(|| format!("No field named {field}"))?;
.with_context(|| format!("No field named {}", field.to_string()))?;
let field_type = field_field.data_type();

if groupby.is_empty() {
// Value replacement for field with no groupby fields specified is equivalent to replacing
// null values of that column with the fill value
let select_columns = self
.schema()
let select_columns = schema
.fields()
.iter()
.map(|f| {
Expand All @@ -1166,8 +1165,7 @@ impl SqlDataFrame {
self.select(select_columns).await
} else {
// Save off names of columns in the original input DataFrame
let original_columns: Vec<_> = self
.schema()
let original_columns: Vec<_> = schema
.fields()
.iter()
.map(|field| field.name().clone())
Expand Down

0 comments on commit bb6e542

Please sign in to comment.