snowflake-connector-python | Snowflake Connector for Python | Database library
kandi X-RAY | snowflake-connector-python Summary
kandi X-RAY | snowflake-connector-python Summary
Snowflake Connector for Python
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Wrapper for urlopen .
- Execute a command .
- Transfer files to the filesystem .
- Write a DataFrame to a Pandas DataFrame .
- Generates a list of SQL statements from a buffer .
- Configure the application .
- Send a request .
- Fetch OCSP response .
- Execute the request .
- Parse the string .
snowflake-connector-python Key Features
snowflake-connector-python Examples and Code Snippets
Community Discussions
Trending Discussions on snowflake-connector-python
QUESTION
I have a snowflake table and I am using the Snowflake Python Connector to insert value into it. Since I have a lot of data I am using a python generator object to insert value into my table.
...ANSWER
Answered 2022-Mar-04 at 07:21If possible don't do this - individual inserts are slow.
Instead batch collect all the values to insert, and then in one INSERT
bring in all the rows.
But let's talk about the code in the question: There's nothing to iterate through. For cursor()
to iterate, first you need results out of somewhere to iterate through.
QUESTION
I'm unable to connect to snowflake via a dockerized pyspark container. I do not find the snowflake documentation to be helpful nor the pyspark documentation at this point in time.
I'm using the following configuration installed & can be seen below in the Dockerfile
- python 3.7.12
- pyspark 3.1.1
- Hadoop 3.2
- jre-1.8.0-openjdk
- snowflake-jdbc-3.13.15.jar
- spark-snowflake_2.12-2.10.0-spark_3.1.jar
- snowflake-connector-python 2.7.4
ANSWER
Answered 2022-Mar-01 at 20:58instead of --jars
, try --packages=net.snowflake:snowflake-jdbc:3.13.14,net.snowflake:spark-snowflake_2.11:2.9.3-spark_2.4
QUESTION
In the docs for the python Snowflake connector, it says that setting the connection parameter converter_class
when creating the connection object can be used to suppress conversion to python types (leaves data as strings). But I see no difference between queries run with the following two connections (using snowflake-connector-python=2.7.0
):
ANSWER
Answered 2021-Nov-24 at 08:37When this feature was added initially it was only meant for JSON result set format. Since then we migrated result set to ARROW and for this format it doesn't work indeed (ARROW is default format now).
To demonstrate I use this code:
QUESTION
It's possible to get the Snowflake Query Id when using the snowflake-connector-python, i.e. the sfqid attribute from the cursor object.
Is it possible to get that attribute when using Snowflake's SQLAlchemy Toolkit? The doc page doesn't mention it - https://docs.snowflake.com/en/user-guide/sqlalchemy.html.
Thanks, Eric
...ANSWER
Answered 2021-Sep-10 at 14:07One way I found was using the function LAST_QUERY_ID, something like this:
QUESTION
Been struggling for a few hours. I'm trying to hit this link That has these contents:
...ANSWER
Answered 2021-Aug-27 at 21:16AdminOfThings provided a good pointer in a comment, but let me try to put it all together:
QUESTION
I received this error when running pip install -r requirements.txt
where snowflake-connector-python==2.3.6
was included. Running pip install snowflake-connector-python
works just fine.
This post suggests it could be an issue with the PYPI CDN.
How can I troubleshoot issues like this in the future?
I'll post the main errors along with an image since the latter is easier to read IMO.
WARNING: Discarding https://files.pythonhosted.org/packages/09/39/65b33cf8ea5a1a6ecc213b8beba65f3860440bd5c4a8c5636e2b8d23afa9/snowflake-connector-python-2.3.6.tar.gz#sha256=1a4ebf25989fc13d6f70dc3e2064721c54834e493a7964a1d67be61d40e75f50 (from https://pypi.org/simple/snowflake-connector-python/) (requires-python:>=3.5). Command errored out with exit status 1: /Users/willwright/miniconda3/bin/python /private/var/folders/c8/9c921tr17gdbjsfbrw4hlgtr0000gn/T/pip-standalone-pip-12vdp_4t/env_pip.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/c8/9c921tr17gdbjsfbrw4hlgtr0000gn/T/pip-build-env-8eydzsmj/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel cython 'pyarrow>=0.17.0,<0.18.0' Check the logs for full command output.
...ERROR: Could not find a version that satisfies the requirement snowflake-connector-python==2.3.6 (from versions: 1.3.17, 1.3.18, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.6.12, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6, 2.3.7, 2.3.8, 2.3.9, 2.3.10, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.5.0, 2.5.1) ERROR: No matching distribution found for snowflake-connector-python==2.3.6
ANSWER
Answered 2021-Aug-03 at 20:46I was on the wrong virtual environment -- this version of the snowflake connector doesn't work with python 3.9. I needed to switch from the default venv to the one I created with python 3.8:
QUESTION
Recently my lambda code stopped working. I am no longer able to create connection to Snowflake with sqlalchemy. See error stack below.
...ANSWER
Answered 2021-Jan-13 at 19:26For completeness, moving the answer from @Clement in a comment to an answer:
This error can happen when loading the oscrypto (libcrypto) if the memory usage is too high. The OOM state cascades upward.
QUESTION
I am working on a notebook on a SageMaker instance at my work. My goal is to connect my jupyter notebook to the snowflake database so as to query some data. Here are some details regarding my problem;
...ANSWER
Answered 2021-Feb-15 at 02:38pip install snowflake-connector-python
QUESTION
From my web UI, Snowflake sql queries through apache & mod_wsgi does not return the results, webpage just hangs. However queries from other databases return results to the front end, only snowflake queries doesn’t work. The same snowflake sql queries return results through development local server (werkzeug)
It seems like a snowflake python driver interaction with Apache seem to be the problem, considering other databases works just fine. Please let us know if you need any additional info. Thank you for your attention
Environment: AWS EC2 – Amazon Linux 2 - centos rhel fedora Apache: 2.4.46 mod-wsgi 4.7.1 (Production WSGI server) Python: 3.7.9 Werkzeug 1.0.1 (development wgsi server with Flask) snowflake-connector-python 2.3.10 (also tried 2.3.7)
...ANSWER
Answered 2021-Mar-01 at 19:28Thanks for your question. Just wanted to let you know that I've faced the same issue: snowflake request just hangs w/o any error or warning (and eventually stops after pretty big timeout I've set to avoid it from hanging forever). My configuration is pretty same as mentioned above; also I tried it on several ubuntu instances, nothing works.
But I was able to make it work on Google Cloud instance; the other issue is that huge requests fail on google cloud with "Exceeded hard memory limit" error; no wonder as it's free tier. But sad moment is that our management decided to pay for ec2 instance, not for google cloud non-free instance. So my custom Flask/Python APi can't return huge csv result file and I think about zipping it as a workaround (if we still continue using free tier there).
Can't really say what they use instead of mod_wsgi on google cloud, but it does work. Just my guess, it's nginx + uWSGI. Related reddit thread: https://www.reddit.com/r/Python/comments/16tm4e/what_wsgi_servers_you_use/
So my suggestion is to (1) try it on Google Cloud instance instead. Or try to (2) install nginx + uWSGI instead of apache + mod_wgsi. As I can't have paid Google Cloud instance on prod, I'm about to try nginx + uWSGI myself.
Also I agree with topic starter that it is not code related at all. Though I also agree with above Simon Darr's and Felipe Hoffa's comments: Snowflake guys need some code to reproduce anyway.
QUESTION
Versions of the libraries we're using:
...ANSWER
Answered 2021-Feb-25 at 18:16I believe the poster filed a Github issue here: https://github.com/great-expectations/great_expectations/issues/2460. The progress can be tracked there.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install snowflake-connector-python
You can use snowflake-connector-python like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page