Skip to content

Commit 76fdd52

Browse files
authored
PYTHON-1157: upgrade notes for dse-driver (scylladb#22)
Add upgrade notes for dse-driver users
1 parent 04ea944 commit 76fdd52

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

docs/api/cassandra/policies.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Load Balancing
3232
.. automethod:: distance
3333
.. automethod:: make_query_plan
3434

35+
.. autoclass:: DefaultLoadBalancingPolicy
36+
:members:
37+
38+
.. autoclass:: DSELoadBalancingPolicy
39+
:members:
40+
3541
Translating Server Node Addresses
3642
---------------------------------
3743

docs/upgrading.rst

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,82 @@ Upgrading
44
.. toctree::
55
:maxdepth: 1
66

7+
Upgrading from dse-driver
8+
-------------------------
9+
10+
Since 3.21.0, cassandra-driver fully supports DataStax products. dse-driver and
11+
dse-graph users should now migrate to cassandra-driver to benefit from latest bug fixes
12+
and new features. The upgrade to this new unified driver version is straightforward
13+
with no major API changes.
14+
15+
Installation
16+
^^^^^^^^^^^^
17+
18+
Only the `cassandra-driver` package should be installed. `dse-driver` and `dse-graph`
19+
are not required anymore::
20+
21+
pip install cassandra-driver
22+
23+
If you need the Graph *Fluent* API (features provided by dse-graph)::
24+
25+
pip install cassandra-driver[graph]
26+
27+
See :doc:`installation` for more details.
28+
29+
Import from the cassandra module
30+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
32+
There is no `dse` module, so you should import from the `cassandra` module. You
33+
need to change only the first module of your import statements, not the submodules.
34+
35+
.. code-block:: python
36+
37+
from dse.cluster import Cluster, EXEC_PROFILE_GRAPH_DEFAULT
38+
from dse.auth import PlainTextAuthProvider
39+
from dse.policies import WhiteListRoundRobinPolicy
40+
41+
# becomes
42+
43+
from cassandra.cluster import Cluster, EXEC_PROFILE_GRAPH_DEFAULT
44+
from cassandra.auth import PlainTextAuthProvider
45+
from cassandra.policies import WhiteListRoundRobinPolicy
46+
47+
dse-graph
48+
^^^^^^^^^
49+
50+
dse-graph features are now built-in in cassandra-driver. The only change you need
51+
to do is your import statements:
52+
53+
.. code-block:: python
54+
55+
from dse_graph import ..
56+
from dse_graph.query import ..
57+
58+
# becomes
59+
60+
from cassandra.datastax.graph.fluent import ..
61+
from cassandra.datastax.graph.fluent.query import ..
62+
63+
See :mod:`~.datastax.graph.fluent`.
64+
65+
Session.execute and Session.execute_async API
66+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67+
68+
Although it is not common to use this API with positional arguments, it is
69+
important to be aware that the `host` and `execute_as` parameters have had
70+
their positional order swapped. This is only because `execute_as` was added
71+
in dse-driver before `host`.
72+
73+
See :meth:`.Session.execute`.
74+
75+
Deprecations
76+
^^^^^^^^^^^^
77+
78+
These changes are optional, but recommended:
79+
80+
* Importing from `cassandra.graph` is deprecated. Consider importing from `cassandra.datastax.graph`.
81+
* Use :class:`~.policies.DefaultLoadBalancingPolicy` instead of DSELoadBalancingPolicy.
82+
783
Upgrading to 3.0
884
----------------
985
Version 3.0 of the DataStax Python driver for Apache Cassandra
@@ -46,7 +122,7 @@ materialize a list using the iterator:
46122
results = session.execute("SELECT * FROM system.local")
47123
row_list = list(results)
48124
49-
For backward compatability, :class:`~.ResultSet` supports indexing. When
125+
For backward compatibility, :class:`~.ResultSet` supports indexing. When
50126
accessed at an index, a `~.ResultSet` object will materialize all its pages:
51127

52128
.. code-block:: python

0 commit comments

Comments
 (0)