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

SNOW-857053: current_schemas() not really pythonic

Open JDarDagran opened this issue 2 years ago • 2 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

3.8.17

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

macOS-13.4.1-arm64-arm-64bit

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

Irrelevant.

  1. What did you do?

Ran this:

 >>> session.create_dataframe([1]).select(functions.current_schemas()).collect()[0]["CURRENT_SCHEMAS()"]
'["MYDB.PUBLIC"]'
  1. What did you expect to see?

A list of schemas, not a string that should be evaluated.

JDarDagran avatar Jul 06 '23 15:07 JDarDagran

thanks for your feedback. I concur with you that it's more pythonic if the returning is list of strings. we will think about this holistically as there are other APIs which are non-pythonic, also changing the returning is a breaking change.

sfc-gh-aling avatar Jul 11 '23 21:07 sfc-gh-aling

I would also love to see this changed but see the point of a breaking change here. Nevertheless with semantic versioning and just moving to another major version this should be no problem. It really makes no sense to return a string here that everyone will eval in the next step, which is evil ;-)

FlorianWilhelm avatar Oct 17 '23 15:10 FlorianWilhelm