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-1566362] Add sql counter check for snowpark python test_cte #2370

Merged
merged 8 commits into from
Oct 2, 2024

Conversation

sfc-gh-yzou
Copy link
Collaborator

@sfc-gh-yzou sfc-gh-yzou commented Sep 30, 2024

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

SNOW-1566362

  1. 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.
  2. Please describe how your code solves the related issue.

  1. Move sql counter check infrastructure from modin to snowpark in general
  2. applies sql counter check to test_cte.py

@sfc-gh-yzou sfc-gh-yzou added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Sep 30, 2024
@sfc-gh-yzou
Copy link
Collaborator Author

@sfc-gh-yzou
Copy link
Collaborator Author

sql_count_records: dict[str, dict[str, list[dict[str, Optional[Scalar]]]]]
sql_count_records: Dict[str, Dict[str, List[Dict[str, Optional[Scalar]]]]]
Copy link
Contributor

Choose a reason for hiding this comment

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

im not sure if this change is actually needed.

Copy link
Collaborator Author

@sfc-gh-yzou sfc-gh-yzou Sep 30, 2024

Choose a reason for hiding this comment

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

yes, that is needed, otherwise it will give an error "type" is not subscritble, it is because the python version restriction, snowpark pandas requires python 3.9 +, so have no problem with using dict, or list, but snowpark python still allows 3.8

@@ -100,6 +104,12 @@ def count_number_of_ctes(query):
lambda x: x.to_df("a1", "b1").alias("L"),
],
)
@sql_count_checker(
Copy link
Contributor

Choose a reason for hiding this comment

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

how about also adding describe_count here and other tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the describe count check is embeded in check_result, which is used in this test point already.
there is also a limitation that the sql_counter_check annotation currently seems not working with describe_count yet, a ticket has been created here to https://snowflakecomputing.atlassian.net/browse/SNOW-1704919 to track the issue

Copy link
Collaborator

@sfc-gh-evandenberg sfc-gh-evandenberg left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-yzou sfc-gh-yzou force-pushed the yzou-SNOW-1566362-sql-counter-tests branch 2 times, most recently from 0e89c42 to c136db4 Compare October 1, 2024 17:54
@sfc-gh-yzou sfc-gh-yzou force-pushed the yzou-SNOW-1566362-sql-counter-tests branch from c136db4 to 8c7dd0d Compare October 1, 2024 22:15
@sfc-gh-yzou sfc-gh-yzou merged commit 32bfa1d into main Oct 2, 2024
35 of 36 checks passed
@sfc-gh-yzou sfc-gh-yzou deleted the yzou-SNOW-1566362-sql-counter-tests branch October 2, 2024 00:05
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
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.

3 participants