Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-872425: Unable to add packages with version specifier when the package name contains underscore #957

Open
sfc-gh-wzhao opened this issue Jul 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@sfc-gh-wzhao
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Python 3.8.13

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

    macOS-13.4.1-arm64-arm-64bit

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

    snowflake-snowpark-python==1.5.1

  4. What did you do?

    Create a session. Then run session.add_packages("huggingface_hub==0.15.1")

  5. 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.
  1. Can you set logging to DEBUG and collect the logs?

I believe the issue lies here

package if not use_local_version and "_" in package else package_req.key
When incoming package contains underscore, it takes the whole package specification as the package name, which incorrectly contains the version specification part.

@sfc-gh-wzhao sfc-gh-wzhao added bug Something isn't working needs triage Initial RCA is required labels Jul 20, 2023
@github-actions github-actions bot changed the title Unable to add packages with version specifier when the package name contains underscore SNOW-872425: Unable to add packages with version specifier when the package name contains underscore Jul 20, 2023
@sfc-gh-stan
Copy link
Collaborator

I can repro, assigned to myself since I need to clean up the deprecating dependencies on pkg_resources.

@sfc-gh-stan sfc-gh-stan removed the needs triage Initial RCA is required label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants