-
Notifications
You must be signed in to change notification settings - Fork 451
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-217037: Restrictive dependencies breaking projects #521
Comments
Hi @avikaps Sorry for the inconvenience, but supporting the newest Is it possible for you to pin the newest version we support in your own requirements file to downgrade the default package version? |
I tried downgrading the Since we're trying to get data from SF on demand using these server less functions and we got this issues in our production pipeline environment. Are there any work-arounds or any other connector(s), that we can use just to make sure it works ? Also, If you guys are trying to fix this issue what will be the tentative timeline that we can expect ? Thanks, |
@sfc-gh-mkeller this OCSP security added is actually a problem when attempting to coexist with any non-trivial application that uses requests in its own right. A fresh install of conda python 3.6 fully upgraded to latest releases, results in this while installing the snowflake-connector-python:
|
I understand @cfinkenstadt |
I have two suggestions, one of which is related to our work-around, For the version-specific issue: vendor requests 2.23, similar to the way snowsql does its own packaging away from the system-supplied modules. For the "breaks everyone else" especially boto3 and normal requests access, we use something close to this work-around # preserve original behavior
import requests.packages.urllib3.connection as connection_
SAVED_CONNECTION = connection_.ssl_wrap_socket
# hello, Snowflake
import snowflake.connector
import snowflake.connector.errorcode
from snowflake.connector.errors import DatabaseError, ProgrammingError
# restore original behavior
connection_.ssl_wrap_socket = SAVED_CONNECTION This suggests that over in snowflake.connector https://github.com/snowflakedb/snowflake-connector-python/blob/master/src/snowflake/connector/connection.py#L406 use a context manager to SET upon entry, and RESTORE upon all exits, the desired OCSP mode in ssl_wrap_socket. |
After thinking on this for a few days, I realize that the context manager way you describe might run into concurrency issues and could cause the same issue. |
Just want to add myself to the list of people impacted by this. Google does not appear to offer any way to manually override the version of their pre-installed dependencies in GCP functions. This means our functions that use
Edit: I manually added |
@sfc-gh-mkeller understood about the concurrency issue using a context manager, it was also a concern of mine but my Python-fu is not yet enough to understand the threading concurrency model in Python. |
Does AWS Lambda support anything but deflate inside the ZIP file archive? (A trick I learned awhile ago in another context, not AWS lambda, though.) |
It looks like you can do over 50 MB
according to https://docs.aws.amazon.com/lambda/latest/dg/python-package.html |
This could be merged in the dependency chaos ticket here: #284 Maybe voicing a bit more the issue with the dependencies will get something moving eventually 👍 |
also wanted to add a +1 to this (and to #284) - would be fantastic to see this connector break out optional dependencies as package extras and relax constraints wherever possible, especially given the more strict new pip dependency resolver. Thanks in advance!!! |
Since we vendored |
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using (
python --version
)? 3.7.7What operating system and processor architecture are you using (
python -c 'import platform; print(platform.platform())'
)?What are the component versions in the environment (
pip freeze
)?deploy it on Google Cloud functions as the Cloud Functions VM has the pre-installed with the listed packages : https://cloud.google.com/functions/docs/writing/specifying-dependencies-python
But the has the package version 'requests==2.24.0' is causing this issues the the dependency in the build, as it is still requires 'requests<2.24.0' version
A complete runnable program is good.
What did you expect to see? requests==2.24.0 has been release quite some time back, please update the dependency
What did you see instead? code broke as it failed to clear the dependency
Can you set logging to DEBUG and collect the logs?
File "/env/local/lib/python3.7/site-packages/pkg_resources/init.py", line 791, in resolve raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (requests 2.24.0 (/env/lib/python3.7/site-packages), Requirement.parse('requests<2.24.0'), {'snowflake-connector-python'})
The text was updated successfully, but these errors were encountered: