Skip to content

Commit

Permalink
Add AVERAGEIF, COUNTIF, SUMIF, and COUNTBLANK (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
HactarCE committed Jun 15, 2023
1 parent 7107338 commit 9d87209
Show file tree
Hide file tree
Showing 18 changed files with 862 additions and 121 deletions.
2 changes: 1 addition & 1 deletion quadratic-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quadratic-core"
version = "0.1.8"
version = "0.1.9"
authors = ["Andrew Farkas <andrew.farkas@quadratic.to>"]
edition = "2021"
description = "Infinite data grid with Python, JavaScript, and SQL built-in"
Expand Down
9 changes: 6 additions & 3 deletions quadratic-core/src/formulas/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,16 @@ impl Formula {
/// Evaluates a formula, blocking on async calls.
///
/// Use this when the grid proxy isn't actually doing anything async.
pub fn eval_blocking(&self, grid: &mut dyn GridProxy, pos: Pos) -> FormulaResult {
pub fn eval_blocking(&self, grid: &mut dyn GridProxy, pos: Pos) -> FormulaResult<Value> {
pollster::block_on(self.eval(grid, pos))
}

/// Evaluates a formula.
pub async fn eval(&self, grid: &mut dyn GridProxy, pos: Pos) -> FormulaResult {
self.ast.eval(&mut Ctx { grid, pos }).await
pub async fn eval(&self, grid: &mut dyn GridProxy, pos: Pos) -> FormulaResult<Value> {
self.ast
.eval(&mut Ctx { grid, pos })
.await?
.into_non_error_value()
}
}

Expand Down
Loading

1 comment on commit 9d87209

@vercel
Copy link

@vercel vercel bot commented on 9d87209 Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

quadratic – ./

quadratic-nu.vercel.app
quadratic-quadratic.vercel.app
quadratic-git-main-quadratic.vercel.app

Please sign in to comment.