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

NO-SNOW: fix sp-precommit test for large_query_breakdown and cte #2404

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

sfc-gh-aalam
Copy link
Contributor

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

    Fixes SNOW-NNNNNNN

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

    Test fails because it cannot detect fixture sql_simplifier_enabled. Reading the value from session to workaround the issue.

example: https://ci-dev-133.int.snowflakecomputing.com/job/RT-PC-TestWorker/203222/testReport/junit/(root)/t_python_sp_integ_sp/snowpark_test_large_query_breakdown_sql/

@sfc-gh-aalam
Copy link
Contributor Author

sfc-gh-aalam commented Oct 4, 2024

@sfc-gh-aalam sfc-gh-aalam changed the title NO-SNOW: fix sp-precommit test for large_query_breakdown NO-SNOW: fix sp-precommit test for large_query_breakdown and cte Oct 7, 2024
@sfc-gh-aalam sfc-gh-aalam added the NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md label Oct 7, 2024
Comment on lines -367 to -369
@decorator
def sql_count_checker(
func,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

updating the implementation because decorator package is not available in SP

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.

Please see comments regarding failures:

sql_count_checker() got an unexpected keyword argument 'fallback_count'

@@ -376,17 +374,8 @@ def sql_count_checker(
udf_count=None,
udtf_count=None,
union_count=None,
*args,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The failure

"sql_count_checker() got an unexpected keyword argument 'fallback_count'"

happens because the *args, **kwargs are removed here.

Not sure if that was intentional. When I add them back, then the test_sql_counter.py tests pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for this. I assumed these were args and kwargs for the func we are decorating so I moved them down to wrapper. I moved it back up now.

@functools.wraps(func)
def wrapper(*args, **kwargs):
sql_counter = SqlCounter(
no_check=no_check,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like all tests that contain 'fallback_count=#' are disabled from being counted by pytest.mark.xfail:

@pytest.mark.xfail(
reason="SNOW-1336091: Snowpark pandas cannot run in sprocs until modin 0.28.1 is available in conda",
strict=True,
raises=RuntimeError,
)

but when you actually run the tests, they fail with some other error such as NotImplementedError.

I believe a long time ago we would go through a 'fallback' to run the code using pandas within a sproc. However, it looks like this was removed by https://github.com/snowflakedb/snowpark-python/pull/1542/files . I'd recommend to check with @sfc-gh-nkrishna here. Perhaps the disabled tests need to be re-evaluated to validate not implemented error rather than skipped in this way.

Copy link
Contributor

@sfc-gh-nkrishna sfc-gh-nkrishna 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-aalam sfc-gh-aalam enabled auto-merge (squash) October 7, 2024 21:58
@sfc-gh-aalam sfc-gh-aalam merged commit cef750a into main Oct 7, 2024
36 checks passed
@sfc-gh-aalam sfc-gh-aalam deleted the aalam-fix-precommit branch October 7, 2024 22:24
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants