-
Notifications
You must be signed in to change notification settings - Fork 108
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-1021381: Remove pkg_resource #2371
base: main
Are you sure you want to change the base?
Conversation
@@ -23,6 +23,7 @@ | |||
"pyyaml", | |||
"cloudpickle>=1.6.0,<=2.2.1,!=2.1.0,!=2.2.0;python_version<'3.11'", | |||
"cloudpickle==2.2.1;python_version~='3.11'", # backend only supports cloudpickle 2.2.1 + python 3.11 at the moment | |||
"packaging", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need an approval from legal team?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need update in the recipe: https:/snowflakedb/snowpark-python/blob/main/recipe/meta.yaml
Args: | ||
name (str): The name of the package. | ||
|
||
Returns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It looks duplicate with description, so may not needed
package_name = package[: reg_match.start()] if reg_match else package | ||
|
||
package_dict[package] = (package_name, use_local_version, package_req) | ||
package_req = Requirement(package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it's directly handled?
@@ -483,14 +513,12 @@ def add_snowpark_package( | |||
channel. | |||
|
|||
Raises: | |||
pkg_resources.DistributionNotFound: If the Snowpark Python Package is not installed in the local environment. | |||
importlib.metadata.PackageNotFoundError: If the Snowpark Python Package is not installed in the local environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we need this in the change log for this error behavior change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an internal API. But we do need to check if any public APIs expose it.
if package.key in DEFAULT_PACKAGES: | ||
_logger.info(f"{package.key} is available by default, ignoring...") | ||
if package.name in DEFAULT_PACKAGES: | ||
_logger.info(f"{package.name} is availna meble by default, ignoring...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
_logger.info(f"{package.name} is availna meble by default, ignoring...") | |
_logger.info(f"{package.name} is available by default, ignoring...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's kick off a stored proc test running for this
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1021381
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Removed pkg_resources in code. Added cod that uses importlib (a python builtin package) and packaging (from pypa).
Added packaging to the project dependency.