Skip to content

Commit

Permalink
Lowercase before snake-casing for conformance test string escaping. (#…
Browse files Browse the repository at this point in the history
…511)

Replace names like: strict_example_7_nu_l_l_and_missin_g_coercion_1
              with: strict_example_7_null_and_missing_coercion_1
  • Loading branch information
jpschorr authored Oct 22, 2024
1 parent 3f9d17f commit 3f3a948
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions partiql-conformance-test-generator/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ fn escape_str(s: &str) -> String {
match s.chars().next() {
None => "_".to_string(),
Some(c) => {
let snake_case = s.to_lowercase().to_snake_case();
if c.is_numeric() {
format!("_{}", s.to_snake_case())
format!("_{}", snake_case)
} else {
s.to_snake_case()
snake_case
}
}
}
Expand Down Expand Up @@ -86,4 +87,12 @@ mod test {
"r#a_b_c_1_2_3_e_f_g"
);
}

#[test]
fn snake_case_uppercase_names() {
assert_eq!(
"Example 7 — NULL and MISSING Coercion - 1".escape_path(),
"example_7_null_and_missing_coercion_1"
);
}
}

1 comment on commit 3f3a948

@github-actions
Copy link

Choose a reason for hiding this comment

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

PartiQL (rust) Benchmark

Benchmark suite Current: 3f3a948 Previous: 3f9d17f Ratio
arith_agg-avg 782025 ns/iter (± 7382) 765428 ns/iter (± 17728) 1.02
arith_agg-avg_distinct 873100 ns/iter (± 20686) 858820 ns/iter (± 20625) 1.02
arith_agg-count 830251 ns/iter (± 18843) 814540 ns/iter (± 16330) 1.02
arith_agg-count_distinct 867471 ns/iter (± 1743) 852711 ns/iter (± 3888) 1.02
arith_agg-min 836826 ns/iter (± 3549) 819503 ns/iter (± 5160) 1.02
arith_agg-min_distinct 871780 ns/iter (± 3362) 856574 ns/iter (± 4490) 1.02
arith_agg-max 841277 ns/iter (± 2470) 827442 ns/iter (± 1701) 1.02
arith_agg-max_distinct 879427 ns/iter (± 2659) 864722 ns/iter (± 1752) 1.02
arith_agg-sum 836546 ns/iter (± 3222) 821912 ns/iter (± 11050) 1.02
arith_agg-sum_distinct 879618 ns/iter (± 5498) 857937 ns/iter (± 2288) 1.03
arith_agg-avg-count-min-max-sum 979416 ns/iter (± 2352) 968498 ns/iter (± 45038) 1.01
arith_agg-avg-count-min-max-sum-group_by 1230521 ns/iter (± 4196) 1221287 ns/iter (± 4423) 1.01
arith_agg-avg-count-min-max-sum-group_by-group_as 1840114 ns/iter (± 24634) 1838260 ns/iter (± 4472) 1.00
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct 1259725 ns/iter (± 30318) 1266617 ns/iter (± 22698) 0.99
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct-group_by 1533973 ns/iter (± 58989) 1556324 ns/iter (± 8387) 0.99
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct-group_by-group_as 2118265 ns/iter (± 7769) 2188553 ns/iter (± 5721) 0.97
parse-1 5897 ns/iter (± 193) 6102 ns/iter (± 28) 0.97
parse-15 50320 ns/iter (± 151) 50272 ns/iter (± 88) 1.00
parse-30 99007 ns/iter (± 955) 99654 ns/iter (± 3473) 0.99
compile-1 4194 ns/iter (± 10) 4225 ns/iter (± 22) 0.99
compile-15 32373 ns/iter (± 235) 32652 ns/iter (± 260) 0.99
compile-30 66932 ns/iter (± 205) 67918 ns/iter (± 193) 0.99
plan-1 70626 ns/iter (± 173) 69724 ns/iter (± 423) 1.01
plan-15 1095103 ns/iter (± 20141) 1094861 ns/iter (± 9322) 1.00
plan-30 2191097 ns/iter (± 6803) 2191116 ns/iter (± 13765) 1.00
eval-1 12926133 ns/iter (± 122547) 13197485 ns/iter (± 249211) 0.98
eval-15 88215128 ns/iter (± 258292) 89259168 ns/iter (± 934982) 0.99
eval-30 169498996 ns/iter (± 2835589) 171668148 ns/iter (± 423756) 0.99
join 10213 ns/iter (± 13) 10085 ns/iter (± 421) 1.01
simple 2539 ns/iter (± 7) 2543 ns/iter (± 9) 1.00
simple-no 457 ns/iter (± 2) 475 ns/iter (± 1) 0.96
numbers 57 ns/iter (± 0) 48 ns/iter (± 0) 1.19
parse-simple 914 ns/iter (± 7) 937 ns/iter (± 4) 0.98
parse-ion 2676 ns/iter (± 7) 2733 ns/iter (± 8) 0.98
parse-group 8178 ns/iter (± 20) 7922 ns/iter (± 23) 1.03
parse-complex 21128 ns/iter (± 164) 20662 ns/iter (± 208) 1.02
parse-complex-fexpr 28822 ns/iter (± 95) 28614 ns/iter (± 227) 1.01

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.