Skip to content

[SNOW-3203938] Fix ai_parse_document_basic test#4109

Open
sfc-gh-mrek wants to merge 3 commits intomainfrom
SNOW-3203938-fix-ai-parser-basic-test
Open

[SNOW-3203938] Fix ai_parse_document_basic test#4109
sfc-gh-mrek wants to merge 3 commits intomainfrom
SNOW-3203938-fix-ai-parser-basic-test

Conversation

@sfc-gh-mrek
Copy link

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

    Fixes SNOW-3203938

  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.

With latest changes related to the new error handling, basic parse document tests started failing because metadata key is mising in the response.
This is expected behaviour, more details can be found here.
I've modified tests to use session parameter, to test both legacy and new response without error details (the bcr process lasts ~3 months, so during this time both combinations will be available for clients).
It affects ai_parse_document only, as for other functions the value didn't change.
New response type is {value:, error}, but when response error details are disabled, value is extracted.
In case of ai_parse_document, metadata was moved to the root level of the response {value,metadata,error} making it absent in value.
As a follow-up, it would be a good idea to cover new error handling with error details in these tests.

@sfc-gh-mrek sfc-gh-mrek requested a review from a team as a code owner March 6, 2026 09:47
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sfc-gh-mrek
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@sfc-gh-mrek sfc-gh-mrek force-pushed the SNOW-3203938-fix-ai-parser-basic-test branch from e6900b3 to 5fe5853 Compare March 6, 2026 09:57
Comment on lines +1076 to +1078
session.sql(
"ALTER SESSION SET AI_SQL_ERROR_HANDLING_USE_FAIL_ON_ERROR = FALSE"
).collect()
Copy link
Contributor

@sfc-gh-aling sfc-gh-aling Mar 6, 2026

Choose a reason for hiding this comment

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

we normally do not do this because our tests run in parallel and it might pollute other test


- Fixed a bug in `Session.client_telemetry` that trace does not have snowflake style trace id.
- Fixed a bug in `ai_complete` where `model_parameters` and `response_format` values containing single quotes would generate malformed SQL.
- Fixed a ai_parse_document test that failed with new error handling
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Fixed a ai_parse_document test that failed with new error handling

Test-only fixes shouldn't have changelog entries.

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.

3 participants