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

SNOW-535152 Updated regex to also include the old error code #1298

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

sfc-gh-jaliu
Copy link
Contributor

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes broken test from 1297

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

Forgot to update regex, regex is now updated

@@ -40,7 +40,9 @@ def test_error_code(conn_cnx):
e.value.sqlstate == syntax_sqlstate
or e.value.sqlstate == syntax_sqlstate_old
), "Syntax SQL state"
e.match(rf"^{syntax_errno:06d} \({syntax_sqlstate}\): ")
e.match(
rf"^({syntax_errno:06d}|{syntax_errno_old:06d}) \(({syntax_sqlstate}|{syntax_sqlstate_old})\): "
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically this would be more precise:

Suggested change
rf"^({syntax_errno:06d}|{syntax_errno_old:06d}) \(({syntax_sqlstate}|{syntax_sqlstate_old})\): "
rf"^({syntax_errno_old:06d} \({syntax_sqlstate_old}\)|{syntax_errno:06d} \({syntax_sqlstate}\)): ":

@codecov-commenter
Copy link

Codecov Report

Merging #1298 (f31ee9e) into main (32b459e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Current head f31ee9e differs from pull request most recent head e3e1268. Consider uploading reports for the commit e3e1268 to get more accurate results

@@            Coverage Diff             @@
##             main    #1298      +/-   ##
==========================================
+ Coverage   81.49%   81.52%   +0.02%     
==========================================
  Files          59       59              
  Lines        8562     8562              
  Branches     1275     1275              
==========================================
+ Hits         6978     6980       +2     
+ Misses       1277     1275       -2     
  Partials      307      307              
Impacted Files Coverage Δ
src/snowflake/connector/test_util.py 53.33% <100.00%> (ø)
src/snowflake/connector/connection.py 90.86% <0.00%> (+0.14%) ⬆️
src/snowflake/connector/errors.py 90.32% <0.00%> (+0.53%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@sfc-gh-mkeller sfc-gh-mkeller left a comment

Choose a reason for hiding this comment

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

🚢 🚢

@sfc-gh-mkeller sfc-gh-mkeller changed the title Updated regex to also include the old error code SNOW-535152 Updated regex to also include the old error code Oct 26, 2022
@sfc-gh-mkeller sfc-gh-mkeller merged commit 5a4e7a6 into main Oct 26, 2022
@sfc-gh-mkeller sfc-gh-mkeller deleted the SNOW-535152-fix-test-failure branch October 26, 2022 06:15
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants