snowpark-python
snowpark-python copied to clipboard
SNOW-872425: Unable to add packages with version specifier when the package name contains underscore
Please answer these questions before submitting your issue. Thanks!
-
What version of Python are you using?
Python 3.8.13
-
What operating system and processor architecture are you using?
macOS-13.4.1-arm64-arm-64bit
-
What are the component versions in the environment (
pip freeze
)?snowflake-snowpark-python==1.5.1
-
What did you do?
Create a session. Then run session.add_packages("huggingface_hub==0.15.1")
-
What did you expect to see?
The package should be able to be added as it is available by checking information_schema.packages table.
What should have happened and what happened instead?
Instead, received
ValueError: Cannot add package huggingface_hub==0.15.1 because it is not available in Snowflake. Check information_schema.packages to see available packages for UDFs. If this package is a "pure-Python" package, you can find the directory of this package and add it via session.add_import(). See details at https://docs.snowflake.com/en/developer-guide/snowpark/python/creating-udfs.html#using-third-party-packages-from-anaconda-in-a-udf.
- Can you set logging to DEBUG and collect the logs?
I believe the issue lies here https://github.com/snowflakedb/snowpark-python/blob/edd7f29d10215eab8b3725d524551f1c164c3745/src/snowflake/snowpark/session.py#L904 When incoming package contains underscore, it takes the whole package specification as the package name, which incorrectly contains the version specification part.
I can repro, assigned to myself since I need to clean up the deprecating dependencies on pkg_resources
.