Skip to content

Commit dc31c58

Browse files
Merge pull request #256 from snowflakedb/prep-2.2.0
Prep 2.2.0
2 parents 51d8dba + 5b3412b commit dc31c58

File tree

133 files changed

+1504
-1510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1504
-1510
lines changed

.coverage2.7rc

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ generated_version.py
9696
*coverage.xml
9797
.idea/
9898
.pytest_cache/
99+
snowflake_connector_python.egg-info/

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
exclude: '^(.*egg.info.*|.*/parameters.py).*$'
2+
repos:
3+
- repo: https://github.com/asottile/seed-isort-config
4+
rev: v1.9.1
5+
hooks:
6+
- id: seed-isort-config
7+
# This work around is necessary until we break the monorepo apart
8+
entry: bash -c "cd Python/snowflake/connector && seed-isort-config"
9+
- repo: https://github.com/pre-commit/mirrors-isort
10+
rev: v4.3.21
11+
hooks:
12+
- id: isort
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v2.2.3
15+
hooks:
16+
- id: trailing-whitespace
17+
- id: end-of-file-fixer
18+
- id: check-yaml
19+
- id: debug-statements
20+
- id: flake8
21+
entry: bash -c "cd Python/snowflake/connector && flake8"
22+
additional_dependencies: ["flake8-bugbear == 19.3.0"]
23+
- repo: https://github.com/asottile/pyupgrade
24+
rev: v1.19.0
25+
hooks:
26+
- id: pyupgrade
27+
entry: bash -c "cd Python/snowflake/connector && pyupgrade"

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ dist: xenial
33
language: python
44
matrix:
55
include:
6-
- os: linux
7-
python: '2.7'
86
- os: linux
97
python: '3.5'
108
- os: linux

DESCRIPTION.rst

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,22 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
99
Release Notes
1010
-------------------------------------------------------------------------------
1111

12+
- v2.2.0(January 27,2020)
13+
14+
- Drop Python 2.7 support
15+
- AWS: When OVERWRITE is false, which is set by default, the file is uploaded if no same file name exists in the stage. This used to check the content signature but it will no longer check. Azure and GCP already work this way.
16+
- Document Python connector dependencies on our GitHub page in addition to Snowflake docs.
17+
- Fix sqlalchemy and possibly python-connector warnings.
18+
- Fix GCP exception using the Python connector to PUT a file in a stage with auto_compress=false.
19+
- Bump up botocore requirements to 1.14.
20+
- Fix uppercaseing authenticator breaks Okta URL which may include case-sensitive elements(#257).
21+
- Fix wrong result bug while using fetch_pandas_all() to get fixed numbers with large scales.
22+
- Increase multi part upload threshold for S3 to 64MB.
23+
1224
- v2.1.3(January 06,2020)
13-
25+
1426
- Fix GCP Put failed after hours
15-
27+
1628
- v2.1.2(December 16,2019)
1729

1830
- Fix the arrow bundling issue for python connector on mac.
@@ -77,7 +89,7 @@ Release Notes
7789
- Fix memory leak in python connector panda df fetch API
7890

7991
- v1.9.1(October 4,2019)
80-
92+
8193
- Add asn1crypto requirement to mitigate incompatibility change.
8294

8395
- v1.9.0(August 26,2019) **REMOVED from pypi due to dependency compatibility issues**
@@ -99,7 +111,7 @@ Release Notes
99111
- Fix Azure Gov PUT and GET issue
100112

101113
- v1.8.6(July 29,2019)
102-
114+
103115
- Reduce retries for OCSP from Python Driver
104116
- Azure PUT issue: ValueError: I/O operation on closed file
105117
- Add client information to USER-AGENT HTTP header - PythonConnector
@@ -135,13 +147,13 @@ Release Notes
135147
- Add Option to Skip Request Pooling
136148
- Add OCSP_MODE metric
137149
- Fixed PUT URI issue for Windows path
138-
- OCSP SoftFail
150+
- OCSP SoftFail
139151

140152
- v1.7.11 (April 22, 2019)
141153

142154
- numpy timestamp with timezone support
143155
- qmark not binding None
144-
156+
145157
- v1.7.10 (April 8, 2019)
146158

147159
- Fix the incorrect custom Server URL in Python Driver for Privatelink
@@ -231,7 +243,7 @@ Release Notes
231243

232244
- Enforce virtual host URL for PUT and GET.
233245
- Added retryCount, clientStarTime for query-request for better service.
234-
246+
235247
- v1.6.6 (August 9, 2018)
236248

237249
- Replaced ``pycryptodome`` with ``pycryptodomex`` to avoid namespace conflict with ``PyCrypto``.
@@ -520,7 +532,7 @@ Release Notes
520532

521533
- Added support for the ``BINARY`` data type, which enables support for more Python data types:
522534

523-
- Python 3:
535+
- Python 3:
524536

525537
- ``bytes`` and ``bytearray`` can be used for binding.
526538
- ``bytes`` is also used for fetching ``BINARY`` data type.
@@ -633,12 +645,12 @@ Release Notes
633645
- v1.0.3 (Jan 13, 2016)
634646

635647
- Added support for the ``BOOLEAN`` data type (i.e. ``TRUE`` or ``FALSE``). This changes the behavior of the binding for the ``bool`` type object:
636-
648+
637649
- Previously, ``bool`` was bound as a numeric value (i.e. ``1`` for ``True``, ``0`` for ``False``).
638650
- Now, ``bool`` is bound as native SQL data (i.e. ``TRUE`` or ``FALSE``).
639651

640652
- Added the ``autocommit`` method to the ``Connection`` object:
641-
653+
642654
- By default, ``autocommit`` mode is ON (i.e. each DML statement commits the change).
643655
- If ``autocommit`` mode is OFF, the ``commit`` and ``rollback`` methods are enabled.
644656

@@ -656,4 +668,3 @@ Release Notes
656668
- v1.0.0 (Dec 1, 2015)
657669

658670
- General Availability release.
659-

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Snowflake Connector for Python
1515

1616
.. image:: http://img.shields.io/:license-Apache%202-brightgreen.svg
1717
:target: http://www.apache.org/licenses/LICENSE-2.0.txt
18-
18+
1919
This package includes the Snowflake Connector for Python, which conforms to the Python DB API 2.0 specification:
2020
https://www.python.org/dev/peps/pep-0249/
2121

@@ -26,7 +26,7 @@ using the Snowflake JDBC or ODBC drivers.
2626

2727
The connector is a native, pure Python package that has no dependencies on JDBC or
2828
ODBC. It can be installed using ``pip`` on Linux, Mac OSX, and Windows platforms
29-
where either Python 2.7.9 (or higher) or Python 3.5.0 (or higher) is installed.
29+
where Python 3.5.0 (or higher) is installed.
3030

3131
Snowflake Documentation is available at:
3232
https://docs.snowflake.net/

__init__.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,39 @@
1414
import logging
1515
from logging import NullHandler
1616

17-
logging.getLogger(__name__).addHandler(NullHandler())
18-
19-
from .version import (VERSION)
20-
from .compat import (TO_UNICODE)
17+
from .compat import TO_UNICODE
2118
from .connection import SnowflakeConnection
2219
from .cursor import DictCursor
20+
from .dbapi import (
21+
BINARY,
22+
DATETIME,
23+
NUMBER,
24+
ROWID,
25+
STRING,
26+
Binary,
27+
Date,
28+
DateFromTicks,
29+
Json,
30+
Time,
31+
TimeFromTicks,
32+
Timestamp,
33+
TimestampFromTicks,
34+
)
2335
from .errors import (
24-
Error, Warning, InterfaceError, DatabaseError,
25-
NotSupportedError, DataError, IntegrityError, ProgrammingError,
26-
OperationalError, InternalError)
27-
from .dbapi import (Timestamp, TimeFromTicks, Time, TimestampFromTicks, Date,
28-
DateFromTicks, Binary, Json,
29-
DATETIME, ROWID, STRING, NUMBER, BINARY)
36+
DatabaseError,
37+
DataError,
38+
Error,
39+
IntegrityError,
40+
InterfaceError,
41+
InternalError,
42+
NotSupportedError,
43+
OperationalError,
44+
ProgrammingError,
45+
Warning,
46+
)
47+
from .version import VERSION
48+
49+
logging.getLogger(__name__).addHandler(NullHandler())
3050

3151

3252
def Connect(**kwargs):

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
theme: jekyll-theme-minimal
1+
theme: jekyll-theme-minimal

arrow_context.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
import time
99
from datetime import datetime, timedelta
1010
from logging import getLogger
11-
from .constants import (
12-
PARAMETER_TIMEZONE)
13-
from .converter import (
14-
_generate_tzinfo_from_tzoffset)
11+
12+
import pytz
13+
14+
from .constants import PARAMETER_TIMEZONE
15+
from .converter import _generate_tzinfo_from_tzoffset
1516

1617
try:
1718
import numpy
1819
except ImportError:
1920
numpy = None
2021

21-
import pytz
2222

2323
try:
2424
import tzlocal
@@ -31,7 +31,9 @@
3131

3232

3333
class ArrowConverterContext(object):
34-
def __init__(self, session_parameters={}):
34+
def __init__(self, session_parameters=None):
35+
if session_parameters is None:
36+
session_parameters = {}
3537
self._timezone = None if PARAMETER_TIMEZONE not in session_parameters else session_parameters[PARAMETER_TIMEZONE]
3638

3739
@property

arrow_iterator.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,3 @@ cdef class PyArrowIterator(EmptyPyArrowIterator):
226226
elif iter_unit == TABLE_UNIT:
227227
self.cIterator = new CArrowTableIterator(<PyObject*>self.context, &self.batches)
228228
self.unit = iter_unit
229-

0 commit comments

Comments
 (0)