Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation for comparison operations #505

Merged
merged 7 commits into from
Oct 11, 2024
Merged

Conversation

jpschorr
Copy link
Contributor

@jpschorr jpschorr commented Oct 9, 2024

Fixes #506


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

github-actions bot commented Oct 9, 2024

Conformance comparison report

Base (36b90c5) e7e6c5c +/-
% Passing 90.35% 90.37% 0.02%
✅ Passing 5731 5732 1
❌ Failing 612 611 -1
🔶 Ignored 0 0 0
Total Tests 6343 6343 0

Number passing in both: 5731

Number failing in both: 611

Number passing in Base (36b90c5) but now fail: 0

Number failing in Base (36b90c5) but now pass: 1

The following test(s) were previously failing but now pass. Before merging, confirm they are intended to pass:

Click here to see
  • partiql_tests::eval::spec_tests::section_7::strict_data_type_mismatch_in_comparison_expression

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 98.55072% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.84%. Comparing base (36b90c5) to head (a2d5e05).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
partiql-value/src/lib.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
+ Coverage   80.78%   80.84%   +0.05%     
==========================================
  Files          80       80              
  Lines       19338    19398      +60     
  Branches    19338    19398      +60     
==========================================
+ Hits        15623    15683      +60     
  Misses       3291     3291              
  Partials      424      424              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jpschorr jpschorr force-pushed the feat-strict-comp-ops branch 2 times, most recently from 4e05f89 to 41c8bc7 Compare October 9, 2024 23:04
@jpschorr jpschorr marked this pull request as ready for review October 9, 2024 23:19
@jpschorr jpschorr requested review from am357 and alancai98 and removed request for alancai98 and am357 October 9, 2024 23:19
@@ -6,7 +6,7 @@ use std::cmp::Ordering;

use std::borrow::Cow;

use std::fmt::{Debug, Formatter};
use std::fmt::{Debug, Display, Formatter, Write};
Copy link
Member

Choose a reason for hiding this comment

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

copying the clippy warning:

unused import: `Write`

warning: unused import: `Write`
 --> partiql-value/src/lib.rs:9:43
  |
9 | use std::fmt::{Debug, Display, Formatter, Write};
  |                                           ^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self.to_pretty_string(f.width().unwrap_or(80)) {
Ok(pretty) => f.write_str(&pretty),
Err(err) => f.write_str("<internal value error occurred>"),
Copy link
Member

Choose a reason for hiding this comment

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

copying the clippy warning

unused variable: `err`

warning: unused variable: `err`
  --> partiql-value/src/lib.rs:68:17
   |
68 |             Err(err) => f.write_str("<internal value error occurred>"),
   |                 ^^^ help: if this is intentional, prefix it with an underscore: `_err`
   |
   = note: `#[warn(unused_variables)]` on by default

Ok(_) => ControlFlow::Continue(result),
Err(value) => {
if STRICT {
// TODO better error messages
Copy link
Member

Choose a reason for hiding this comment

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

Could this be addressed in this PR? Otherwise can track in a separate issue?

@jpschorr jpschorr merged commit 3f9d17f into main Oct 11, 2024
19 checks passed
@jpschorr jpschorr deleted the feat-strict-comp-ops branch October 11, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement strict mode errors for comparison ops and BETWEEN
3 participants