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-1936603: fix limit 0 bug with show #3090

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sfc-gh-fhe
Copy link

@sfc-gh-fhe sfc-gh-fhe commented Feb 27, 2025

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

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

    When checking to use self.limit_ or n in the select statement limit function, we first check if self.limit_ is true. The issue with that is if self.limit_ is 0, it always evaluates to false and uses n instead.

@sfc-gh-fhe sfc-gh-fhe force-pushed the fhe-SNOW-1936603-fix-limit-0-show-bug branch from 28c2209 to 2bc8238 Compare February 28, 2025 20:49
@sfc-gh-fhe sfc-gh-fhe force-pushed the fhe-SNOW-1936603-fix-limit-0-show-bug branch 2 times, most recently from 22ebeca to 47ac899 Compare March 3, 2025 19:41
@sfc-gh-aling
Copy link
Contributor

hey @sfc-gh-fhe , the local testing tests are failing
I believe you need to apply your fix to this part of code: https://github.com/snowflakedb/snowpark-python/blob/main/src/snowflake/snowpark/mock/_select_statement.py#L521-L527
then local testing tests shall pass

@github-actions github-actions bot added the local testing Local Testing issues/PRs label Mar 3, 2025
CHANGELOG.md Outdated
@@ -15,6 +15,7 @@

- Fixed a bug where creating a Dataframe with large number of values raised `Unsupported feature 'SCOPED_TEMPORARY'.` error if thread-safe session was disabled.
- Fixed a bug where `df.describe` raised internal SQL execution error when the dataframe is created from reading a stage file and CTE optimization is enabled.
- Fixed a bug where `df.show` would still show rows after a `df.limit(0)` call was applied to it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't just for df.show(). It's for df.limit(). I suggest updating this description.

Copy link
Author

@sfc-gh-fhe sfc-gh-fhe Mar 3, 2025

Choose a reason for hiding this comment

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

This worked fine for df.collect() and df.count(). I believe it was just a df.show() issue

@sfc-gh-fhe sfc-gh-fhe force-pushed the fhe-SNOW-1936603-fix-limit-0-show-bug branch from 8490f43 to 1d8725d Compare March 11, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
local testing Local Testing issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants