snowflakedb / snowflakedb/snowpark-python
SNOW-650150: Add some indication to `DataFrame.show()` that it isn't all the results
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 341
- Forks
- 155
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 27
Description
What is the current behavior?
No indication that show is only printing top results, which could mislead users that aren't aware.
>>> df = session.range(1,12).to_df('col1') # create 11 element sequence
>>> df.show()
----------
|"COL1" |
----------
|1 |
|2 |
|3 |
|4 |
|5 |
|6 |
|7 |
|8 |
|9 |
|10 |
----------
>>> df.show(n=11)
----------
|"COL1" |
----------
|1 |
|2 |
|3 |
|4 |
|5 |
|6 |
|7 |
|8 |
|9 |
|10 |
|11 |
----------
What is the desired behavior?
Option 1:
Some indication that this is a paged result. Like 1/n, or 15 out of # rows (if that is efficient to do).
Option 2:
Create a DataFrame.head() function that replicates pandas behavior, making it more obvious that this is a preview.
How would this improve snowflake-snowpark-python?
Users will not accidentally realize that they are omitting results when results sets are right around the threshold of show
References, Other Background
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the DataFrame.show() entry point and its existing tests. Compare the two proposed behaviors—an indication that results are limited or a DataFrame.head() method—and confirm the intended direction before implementation. Done means users can clearly tell when show() omits rows, with coverage for the 11-row example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100