You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "LucaCappelletti94 (via GitHub)" <gi...@apache.org> on 2026/10/13 19:16:46 UTC

[PR] Assert exact errors in negative tests (1/4): PostgreSQL tests [datafusion-sqlparser-rs]

LucaCappelletti94 opened a new pull request, #2628:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2628

   This series of PRs, of which this is by far the largest one, will allow us to avoid re-occurrences of the silent error I found earlier today, i.e. an expression failing but not in the expected manner.
   
   Negative tests written as `assert!(result.is_err())` pass when parsing fails for any reason, so a regression that fails earlier for an unrelated reason goes unnoticed. This pins the exact `ParserError` at the 81 such sites for postgres.
   
   `ADD FUNCTION 1 () func` was commented as missing the argument parentheses, which PostgreSQL accepts. PostgreSQL rejects the empty `()`, and the comment now says so.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Assert exact errors in negative tests (1/4): PostgreSQL tests [datafusion-sqlparser-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #2628:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2628


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Assert exact errors in negative tests (1/4): PostgreSQL tests [datafusion-sqlparser-rs]

Posted by "LucaCappelletti94 (via GitHub)" <gi...@apache.org>.
LucaCappelletti94 commented on PR #2628:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2628#issuecomment-6175088491

   @alamb if you could check out these series of PRs they are all rather fast to process I believe.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Assert exact errors in negative tests (1/4): PostgreSQL tests [datafusion-sqlparser-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #2628:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2628#discussion_r4275671468


##########
tests/sqlparser_postgres.rs:
##########
@@ -5131,7 +5131,10 @@ $$"#;
     );
 
     let incorrect_sql = "CREATE FUNCTION add(function(struct<a,b> int64), b INTEGER) RETURNS INTEGER LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE AS 'select $1 + $2;'";
-    assert!(pg().parse_sql_statements(incorrect_sql).is_err(),);
+    assert_eq!(
+        pg().parse_sql_statements(incorrect_sql).unwrap_err(),
+        ParserError::ParserError("Expected: type modifiers, found: <".to_string())

Review Comment:
   💯 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Assert exact errors in negative tests (1/4): PostgreSQL tests [datafusion-sqlparser-rs]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2628:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2628#issuecomment-6155401875

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/pull/2628?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 81.16%. Comparing base ([`dacdbc9`](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/commit/dacdbc99cd16c335fccd353ba41f6c18a7cd73b8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3f76e4f`](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/commit/3f76e4f363b990be0a4b0889c55fc4b20bcd8a40?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##             main    #2628   +/-   ##
   =======================================
     Coverage   81.16%   81.16%           
   =======================================
     Files          42       42           
     Lines       33769    33769           
     Branches    33769    33769           
   =======================================
     Hits        27408    27408           
     Misses       2797     2797           
     Partials     3564     3564           
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion-sqlparser-rs/pull/2628?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org