snowpark-python icon indicating copy to clipboard operation
snowpark-python copied to clipboard

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

Open shanefrieskh opened this issue 1 year ago • 1 comments

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

shanefrieskh avatar Apr 04 '24 22:04 shanefrieskh

@shanefrieskh would you mind creating a PR for this? Keep in mind the circular import between dataframe.py and table.py

https://adamj.eu/tech/2021/05/13/python-type-hints-how-to-fix-circular-imports/

sfc-gh-aalam avatar Apr 05 '24 00:04 sfc-gh-aalam