Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
andicuko committed Mar 20, 2024
1 parent d3c9b55 commit b20d97a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/data_type/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl fmt::Display for Float {
let lower_threshold = 1e-4;
let upper_threshold = 1e4;

if self.0.abs() >= lower_threshold && self.0.abs() < upper_threshold {
if self.0.abs() >= lower_threshold && self.0.abs() < upper_threshold && self.0 == 0.0 {
// Standard decimal notation
write!(f, "{}", self.0)
} else {
Expand Down
9 changes: 8 additions & 1 deletion src/differential_privacy/aggregates.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use crate::{
builder::{With, WithIterator}, data_type::DataTyped, differential_privacy::{dp_event::{self, DpEvent}, DpRelation, Error, Result}, display::Dot, expr::{aggregate::{self, Aggregate}, AggregateColumn, Column, Expr, Identifier}, privacy_unit_tracking::PupRelation, relation::{field::Field, Map, Reduce, Relation, Variant}, DataType, Ready
builder::{With, WithIterator},
data_type::DataTyped,
differential_privacy::dp_event::DpEvent,
differential_privacy::{dp_event, DpRelation, Error, Result},
expr::{aggregate::{self, Aggregate}, AggregateColumn, Expr, Column, Identifier},
privacy_unit_tracking::PupRelation,
relation::{field::Field, Map, Reduce, Relation, Variant},
DataType, Ready,

};
use std::{cmp, collections::HashMap, ops::Deref};
Expand Down
15 changes: 0 additions & 15 deletions src/expr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1971,21 +1971,6 @@ mod tests {
);
}

#[test]
fn test_case_bis() {
let expression = expr!(case(gt(x, 5), x, y));
println!("\nexpression = {}", expression);
println!("expression data type = {}", expression.data_type());
let set = DataType::structured([
("x", DataType::float_interval(1., 10.)),
("y", DataType::float_values([-2., 0.5])),
]);
println!(
"expression super image = {}",
expression.super_image(&set).unwrap()
);
}

#[test]
fn test_in_list_integer() {
// a IN (1, 2, 3)
Expand Down
6 changes: 5 additions & 1 deletion src/sql/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

use super::{Error, Result};
use crate::{
builder::{WithContext, WithoutContext}, data_type::function::Function, expr::{identifier::Identifier, Expr, Value}, hierarchy::{Hierarchy, Path}, namer, visitor::{self, Acceptor, Dependencies, Visited}
builder::{WithContext, WithoutContext},
expr::{identifier::Identifier, Expr, Value},
hierarchy::{Hierarchy, Path},
visitor::{self, Acceptor, Dependencies, Visited},
namer,
};
use itertools::Itertools;
use sqlparser::{
Expand Down

0 comments on commit b20d97a

Please sign in to comment.