Skip to content

SNOW-2084165: Update str(ex_info) to str(ex_info.value) for better string checks#3361

Merged
sfc-gh-aalam merged 3 commits intomainfrom
aalam-SNOW-2084165-fix-ex-info
May 15, 2025
Merged

SNOW-2084165: Update str(ex_info) to str(ex_info.value) for better string checks#3361
sfc-gh-aalam merged 3 commits intomainfrom
aalam-SNOW-2084165-fix-ex-info

Conversation

@sfc-gh-aalam
Copy link
Copy Markdown
Contributor

@sfc-gh-aalam sfc-gh-aalam commented May 14, 2025

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

    Fixes SNOW-2084165

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

    This PR is split up from SNOW-2084165 Add dataframe operation lineage on SnowparkSQLException #3339

    str(ex_info) compresses the error using ... and some of the expected string in string matching gets hidden into the .... We make these updates to find the expected string in the full error string.

example str(ex_info) output

<ExceptionInfo SnowparkSQLException('snowflake.snowpark.exceptions.SnowparkSQLException: (1304): 01bc4ee1-0a10-0849-000c-a909c7a27113...s/snowpark-python/tests/integ/test_function.py|787:9-787:52:  session.create_dataframe([4], schema=["a"])', None, None) tblen=2>

example str(ex_info.value) output

snowflake.snowpark.exceptions.SnowparkSQLException: (1304): 01bc4ee1-0a10-0849-000c-a909c7a27113: 100044 (22P01): Invalid floating point operation: sqrt(-1)


--- Additional Debug Information ---


Trace of the dataframe operations that could have caused the error (total 2):

/Users/aalam/Projects/snowpark-python/tests/integ/test_function.py|793:8-793:32:  df.select(sqrt(lit(-1))).collec
/Users/aalam/Projects/snowpark-python/tests/integ/test_function.py|787:9-787:52:  session.create_dataframe([4], schema=["a"])

@sfc-gh-snowflakedb-snyk-sa
Copy link
Copy Markdown

sfc-gh-snowflakedb-snyk-sa commented May 14, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@sfc-gh-aalam sfc-gh-aalam added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label May 14, 2025
@sfc-gh-jrose sfc-gh-jrose requested a review from a team May 15, 2025 17:14
@sfc-gh-helmeleegy
Copy link
Copy Markdown
Contributor

This seems useful. Thanks for working on this.

@sfc-gh-aalam sfc-gh-aalam merged commit dc8ac30 into main May 15, 2025
95 of 101 checks passed
@sfc-gh-aalam sfc-gh-aalam deleted the aalam-SNOW-2084165-fix-ex-info branch May 15, 2025 18:54
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md snowpark-pandas

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants