Skip to content

Commit 11ac6bb

Browse files
committed
Merge branch 'master-private' into ngdg_master_ft
2 parents c29ffbe + e696a82 commit 11ac6bb

File tree

18 files changed

+78
-63
lines changed

18 files changed

+78
-63
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Features
3939
* Support NULL in collection deserializer (PYTHON-1123)
4040
* Avoid warnings about unspecified load balancing policy when connecting to a cloud cluster (PYTHON-1177)
4141
* Add Python 3.8 support (PYTHON-1189)
42+
* Add new DSE CQL keywords (PYTHON-1122)
4243
* [GRAPH] Ability to execute Fluent Graph queries asynchronously (PYTHON-1129)
4344
4445
Bug Fixes
@@ -48,9 +49,12 @@ Bug Fixes
4849
* Reconnect attempts persist after downed node removed from peers (PYTHON-1181)
4950
* Connection fails to validate ssl certificate hostname when SSLContext.check_hostname is set (PYTHON-1186)
5051
* ResponseFuture._set_result crashes on connection error when used with PrepareMessage (PYTHON-1187)
52+
* Insights fail to serialize the startup message when the SSL Context is from PyOpenSSL (PYTHON-1192)
5153

5254
Others
5355
------
56+
* The driver has a new dependency: geomet. It comes from the dse-driver unification and
57+
is used to support DSE geo types.
5458

5559
Deprecations
5660
------------

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
DataStax Python Driver for Apache Cassandra and DataStax products
2-
=================================================================
1+
DataStax Driver for Apache Cassandra
2+
====================================
33

44
.. image:: https://travis-ci.org/datastax/python-driver.png?branch=master
55
:target: https://travis-ci.org/datastax/python-driver

build.yaml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,6 @@ schedules:
153153
- python: [3.4, 3.6, 3.7, 3.8]
154154
- cassandra: ['2.0', '2.1', '2.2', '3.0', 'test-dse']
155155

156-
# TODO: Temporary, don't merge me
157-
python_oss_next_tests:
158-
schedule: adhoc
159-
disable_pull_requests: true
160-
branches:
161-
include: [/oss-next.*/]
162-
env_vars: |
163-
EVENT_LOOP_MANAGER='libev'
164-
EXCLUDE_LONG=1
165-
matrix:
166-
exclude:
167-
- python: [3.4, 3.6, 3.7, 3.8]
168-
169156
python:
170157
- 2.7
171158
- 3.4
@@ -192,7 +179,7 @@ cassandra:
192179
env:
193180
CYTHON:
194181
- CYTHON
195-
# - NO_CYTHON
182+
- NO_CYTHON
196183

197184
build:
198185
- script: |
@@ -210,7 +197,12 @@ build:
210197
211198
pip install git+ssh://[email protected]/riptano/ccm-private.git
212199
213-
pip install -r test-requirements.txt
200+
if [ -n "$CCM_IS_DSE" ]; then
201+
pip install -r test-datastax-requirements.txt
202+
else
203+
pip install -r test-requirements.txt
204+
fi
205+
214206
pip install nose-ignore-docstring
215207
pip install nose-exclude
216208
pip install service_identity
@@ -277,14 +269,6 @@ build:
277269
echo "==========RUNNING INTEGRATION TESTS=========="
278270
EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CCM_ARGS="$CCM_ARGS" DSE_VERSION=$DSE_VERSION CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION MAPPED_CASSANDRA_VERSION=$MAPPED_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=standard_results.xml tests/integration/standard/ || true
279271
280-
# TODO: Temporary, don't merge this 2.1 stuff...
281-
# if [ "$CCM_CASSANDRA_VERSION" == "2.1.21" ]; then
282-
# echo "Testing cassandra 2.1 with protocol V2"
283-
# PROTOCOL_VERSION=2 EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CCM_ARGS="$CCM_ARGS" CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION MAPPED_CASSANDRA_VERSION=$MAPPED_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=standard_v2_results.xml tests/integration/standard/ || true
284-
# echo "Testing cassandra 2.1 with protocol V1"
285-
# PROTOCOL_VERSION=1 EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CCM_ARGS="$CCM_ARGS" CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION MAPPED_CASSANDRA_VERSION=$MAPPED_CASSANDRA_VERSION VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=standard_v1_results.xml tests/integration/standard/ || true
286-
# fi
287-
288272
if [ -n "$DSE_VERSION" ] && ! [[ $DSE_VERSION == "4.8"* ]]; then
289273
echo "==========RUNNING DSE INTEGRATION TESTS=========="
290274
EVENT_LOOP_MANAGER=$EVENT_LOOP_MANAGER CASSANDRA_DIR=$CCM_INSTALL_DIR DSE_VERSION=$DSE_VERSION ADS_HOME=$HOME/ VERIFY_CYTHON=$FORCE_CYTHON nosetests -s -v --logging-format="[%(levelname)s] %(asctime)s %(thread)d: %(message)s" --with-ignore-docstrings --with-xunit --xunit-file=dse_results.xml tests/integration/advanced/ || true

cassandra/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class ProtocolVersion(object):
191191

192192
MAX_SUPPORTED = max(SUPPORTED_VERSIONS)
193193
"""
194-
Maximum protocol versioni supported by this driver.
194+
Maximum protocol version supported by this driver.
195195
"""
196196

197197
@classmethod

cassandra/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ class TransitionalModePlainTextAuthProvider(object):
150150
auth_provider = TransitionalModePlainTextAuthProvider()
151151
cluster = Cluster(auth_provider=auth_provider)
152152
153-
.. warning:: TransitionalModePlainTextAuthProvider will be removed in dse-driver
154-
3.0. The transitional mode will be handled internally without the need
153+
.. warning:: TransitionalModePlainTextAuthProvider will be removed in cassandra-driver
154+
4.0. The transitional mode will be handled internally without the need
155155
of any auth provider.
156156
"""
157157

cassandra/cluster.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def __init__(self, load_balancing_policy=None, retry_policy=None,
450450
See also :class:`~.GraphExecutionPolicy`.
451451
452452
In addition to default parameters shown in the signature, this profile also defaults ``retry_policy`` to
453-
:class:`dse.policies.NeverRetryPolicy`, and ``load_balancing_policy`` to one that targets the current Spark
453+
:class:`cassandra.policies.NeverRetryPolicy`, and ``load_balancing_policy`` to one that targets the current Spark
454454
master.
455455
456456
Note: The graph_options.graph_source is set automatically to b'a' (analytics)
@@ -3055,7 +3055,7 @@ def prepare(self, query, custom_payload=None, keyspace=None):
30553055
future = ResponseFuture(self, message, query=None, timeout=self.default_timeout)
30563056
try:
30573057
future.send_request()
3058-
response = future.result()[0]
3058+
response = future.result().one()
30593059
except Exception:
30603060
log.exception("Error preparing query:")
30613061
raise

cassandra/datastax/insights/reporter.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,23 @@ def _get_startup_data(self):
135135
'ignored': host_distances_counter[HostDistance.IGNORED]
136136
}
137137

138-
compression_type = cc._connection._compression_type if cc._connection else 'NONE'
138+
try:
139+
compression_type = cc._connection._compression_type
140+
except AttributeError:
141+
compression_type = 'NONE'
139142

140-
if self._session.cluster.ssl_context:
141-
cert_validation = self._session.cluster.ssl_context.verify_mode == ssl.CERT_REQUIRED
142-
elif self._session.cluster.ssl_options:
143-
cert_validation = self._session.cluster.ssl_options.get('cert_reqs') == ssl.CERT_REQUIRED
144-
else:
145-
cert_validation = None
143+
cert_validation = None
144+
try:
145+
if self._session.cluster.ssl_context:
146+
if isinstance(self._session.cluster.ssl_context, ssl.SSLContext):
147+
cert_validation = self._session.cluster.ssl_context.verify_mode == ssl.CERT_REQUIRED
148+
else: # pyopenssl
149+
from OpenSSL import SSL
150+
cert_validation = self._session.cluster.ssl_context.get_verify_mode() != SSL.VERIFY_NONE
151+
elif self._session.cluster.ssl_options:
152+
cert_validation = self._session.cluster.ssl_options.get('cert_reqs') == ssl.CERT_REQUIRED
153+
except Exception as e:
154+
log.debug('Unable to get the cert validation: {}'.format(e))
146155

147156
uname_info = platform.uname()
148157

@@ -157,7 +166,7 @@ def _get_startup_data(self):
157166
},
158167
},
159168
'data': {
160-
'driverName': 'DataStax Enterprise Python Driver',
169+
'driverName': 'DataStax Python Driver',
161170
'driverVersion': sys.modules['cassandra'].__version__,
162171
'clientId': str(self._session.cluster.client_id),
163172
'sessionId': str(self._session.session_id),

cassandra/metadata.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@
5757
'permissions', 'primary', 'rename', 'replace', 'returns', 'revoke', 'role', 'roles', 'schema', 'select', 'set',
5858
'sfunc', 'smallint', 'static', 'storage', 'stype', 'superuser', 'table', 'text', 'time', 'timestamp', 'timeuuid',
5959
'tinyint', 'to', 'token', 'trigger', 'truncate', 'ttl', 'tuple', 'type', 'unlogged', 'update', 'use', 'user',
60-
'users', 'using', 'uuid', 'values', 'varchar', 'varint', 'view', 'where', 'with', 'writetime'
60+
'users', 'using', 'uuid', 'values', 'varchar', 'varint', 'view', 'where', 'with', 'writetime',
61+
62+
# DSE specifics
63+
"node", "nodes", "plan", "active", "application", "applications", "java", "executor", "executors", "std_out", "std_err",
64+
"renew", "delegation", "no", "redact", "token", "lowercasestring", "cluster", "authentication", "schemes", "scheme",
65+
"internal", "ldap", "kerberos", "remote", "object", "method", "call", "calls", "search", "schema", "config", "rows",
66+
"columns", "profiles", "commit", "reload", "unset", "rebuild", "field", "workpool", "any", "submission", "indices",
67+
"restrict", "unrestrict"
6168
))
6269
"""
6370
Set of keywords in CQL.

cassandra/policies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,8 +1168,8 @@ class DSELoadBalancingPolicy(DefaultLoadBalancingPolicy):
11681168
*Deprecated:* This will be removed in the next major release,
11691169
consider using :class:`.DefaultLoadBalancingPolicy`.
11701170
"""
1171-
def __init__(self, *args):
1172-
super(DSELoadBalancingPolicy, self).__init__(*args)
1171+
def __init__(self, *args, **kwargs):
1172+
super(DSELoadBalancingPolicy, self).__init__(*args, **kwargs)
11731173
warnings.warn("DSELoadBalancingPolicy will be removed in 4.0. Consider using "
11741174
"DefaultLoadBalancingPolicy.", DeprecationWarning)
11751175

cassandra/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def _write_query_params(self, f, protocol_version):
589589
else:
590590
raise UnsupportedOperation(
591591
"Keyspaces may only be set on queries with protocol version "
592-
"DSE_V2 or higher. Consider setting Cluster.protocol_version to ProtocolVersion.DSE_V2.")
592+
"5 or DSE_V2 or higher. Consider setting Cluster.protocol_version.")
593593

594594
if ProtocolVersion.uses_int_query_flags(protocol_version):
595595
write_uint(f, flags)

0 commit comments

Comments
 (0)