snowflakedb / snowflakedb/snowpark-python

SNOW-1306306: `DataFrame.cache_result()` type hinting

Open
#1,368 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs triage
Dominant language
Python
Stars
341
Forks
155
Avg merge
4d 16h
Merged PRs (30d)
27

Description

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Python 3.11.2

  2. What operating system and processor architecture are you using?

    macOS-14.2.1-arm64-arm-64bit

  3. What are the component versions in the environment (pip freeze)?

n/a

  1. What did you do?

    Cache result of a DataFrame and pylance type hinting in VScode shows type Any

  2. What did you expect to see?

image

In this line using from snowflake.snowpark.table import Table will provide better typing hinting because of the absolute import

After the change:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/snowflake/snowpark/dataframe.py around line 165 and inspect the DataFrame.cache_result() type annotation and its Table import. Verify the import used there with Pylance in VS Code; done means the cached result is no longer reported as Any and receives the expected type hint.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.