@@ -16,46 +16,118 @@ The format is based on `Keep a Changelog`_, and this project adheres to
16
16
Unreleased _
17
17
-----------
18
18
19
+ This is a major release that brings significant improvements including Python 3 support, async drivers, enhanced CLI tools, and comprehensive modernization of the codebase. This release is **NOT backward compatible ** with 2.4.x.
20
+
19
21
Added
20
22
~~~~~
21
23
22
- * `ValueError ` raised by `ReqlTimeoutError ` and `ReqlAuthError ` if only host or port set
23
- * New error type for invalid handshake state: `InvalidHandshakeStateError `
24
+ * **Python 3 Support **: Full Python 3 compatibility with support for Python 3.10+
25
+ * **Async Drivers **: Ported async/await support for multiple event loop implementations:
26
+ * `rethinkdb.net_asyncio ` - Native asyncio support with async/await syntax and `Connection ` API
27
+ * `rethinkdb.net_gevent ` - Gevent-based async support with `Connection ` API
28
+ * `rethinkdb.net_tornado ` - Tornado integration using `IOLoop ` and `Connection ` API
29
+ * `rethinkdb.net_trio ` - Trio support with `Connection ` API
30
+ * `rethinkdb.net_twisted ` - Twisted integration with `inlineCallbacks ` and `Connection ` API
31
+ * **CLI Tools (Click-based) **:
32
+ * `rethinkdb dump `, `export `, `import `, `index-rebuild `, `repl `, `restore `
33
+ * All commands accept common flags/options: `-q/--quiet `, `--debug `, `-c/--connect `, `--driver-port `, `--host-name `, `-u/--user `, `-p/--password `, `--password-file `, `--tls-cert `
34
+ * `export ` supports `--format json|csv|ndjson|jsongz `, `--delimiter ` (CSV), `--compression-level ` (jsongz), `--fields `, `--clients `, `--read-outdated `
35
+ * **Type Hints **: Extensive typing across modules
36
+ * **Modern Build/Packaging **: `pyproject.toml ` + Poetry
37
+ * **Tests **: New integration tests for each async driver: `tests/integration/test_net_{asyncio,gevent,tornado,trio,twisted}.py `
38
+ * **Documentation **: Sphinx docs under `docs/ ` with API, history, and vulnerabilities
39
+ * **CI/CD **: GitHub Actions workflows; pre-commit hooks for linting/formatting
40
+ * **Protocol Buffer **: `rethinkdb/ql2_pb2.py ` now tracked in VCS
24
41
25
42
Changed
26
43
~~~~~~~
27
44
28
- * QueryPrinter's `print_query ` became a property and renamed to `query `
29
- * QueryPrinter's `print_carrots ` became a property and renamed to `carrots `
30
- * Renamed `ReqlAvailabilityError ` to `ReqlOperationError `
31
- * Extract REPL helper class to a separate file
32
- * `HandshakeV1_0 ` is waiting `bytes ` for `username ` and `password ` attributes instead of `str `
33
- * `HandshakeV1_0 ` defines `username ` and `password ` attributes as protected attributes
34
- * `HandshakeV1_0 ` has a hardcoded `JSONEncoder ` and `JSONDecoder ` from now on
35
- * `HandshakeV1_0 ` raises `InvalidHandshakeStateError ` when an unrecognized state called in `next_message `
36
- * Moved `ReQLEncoder `, `ReQLDecoder `, `recursively_make_hashable ` to `encoder ` module
37
- * Moved `T ` to `utilities ` to module and renamed to `EnhancedTuple `
38
- * Renamed `EnhancedTuple `/`T `'s `intsp ` parameter to `int_separator `
39
- * Renamed `recursively_make_hashable ` to `make_hashable `
40
- * Renamed `optargs ` to `kwargs ` in `ast ` module
41
- * Renamed internal `_continue ` method of connection to `resume ` to make it public
42
- * Internal `_stop `, `_continue ` methods of `Connection ` became public
43
- * Renamed internal `_error ` to `raise_error `
44
- * Internal `_extend `, `_error ` of `Cursor ` became public
45
- * Renamed `Rql* ` to `Reql* `
45
+ API and behavior changes (including breaking changes) compared to 2.4.x:
46
+
47
+ * **Namespace and Entry Point **:
48
+ * The `r ` entry point is now a `SimpleNamespace ` exposing query helpers in `rethinkdb/__init__.py `
49
+ * A lightweight `Client ` wrapper is provided to manage connection loop types via `set_loop_type() `
50
+ * **Exceptions and Error Handling **:
51
+ * Renamed `Rql* ` to `Reql* ` across the codebase; removed `Rql* ` aliases
52
+ * Introduced `InvalidHandshakeStateError ` for invalid handshake transitions
53
+ * `ReqlAuthError ` raises `ValueError ` if only host or only port is provided; includes host:port in message if both are provided
54
+ * `ReqlTimeoutError ` now subclasses `TimeoutError ` and mirrors `ReqlAuthError ` host/port validation and messaging
55
+ * **QueryPrinter (errors.QueryPrinter) **:
56
+ * `print_query ` -> property `query `
57
+ * `print_carrots ` -> property `carets `
58
+ * Error messages now embed composed query and caret markers
59
+ * **Handshake (`rethinkdb.handshake.HandshakeV1_0`) **:
60
+ * Uses protected attributes for credentials: `__username `, `__password `
61
+ * Username is escaped as per RFC (`, ` => `=2C `, `= ` => `=3D `)
62
+ * Accepts optional `json_encoder `/`json_decoder ` (defaults to `json.JSONEncoder `/`json.JSONDecoder `)
63
+ * Raises `ReqlAuthError ` for auth failures (error_code 10..20), `ReqlDriverError ` for other handshake errors
64
+ * Raises `InvalidHandshakeStateError ` on unexpected/unknown state and on invalid transitions in `next_message `
65
+ * Validates server protocol version range and server signature per SCRAM-SHA-256
66
+ * **Encoder/Decoder (`rethinkdb.encoder`) **:
67
+ * Introduced `ReqlEncoder ` and `ReqlDecoder ` classes
68
+ * Moved pseudo-type conversions here (TIME, BINARY, GROUPED_DATA)
69
+ * Renamed utility `recursively_make_hashable ` -> `make_hashable `
70
+ * **Utilities **:
71
+ * Moved `T ` to `rethinkdb.utils.EnhancedTuple ` and renamed parameter `intsp ` -> `int_separator `
72
+ * `utilities.py ` renamed/moved to `utils.py `
73
+ * **AST (`rethinkdb.ast`) **:
74
+ * Renamed internal `optargs ` to `kwargs ` consistently across query node implementations
75
+ * Query operators improved for infix precedence; better error hints for misuse (e.g., `a < b | b < c `)
76
+ * `__str__ ` of queries now uses `QueryPrinter(self).query `
77
+ * **Cursor/Connection (`rethinkdb.net`) **:
78
+ * `Connection.resume(cursor) ` replaces `_continue ` (now public)
79
+ * `Connection.stop(cursor) ` replaces `_stop ` (now public)
80
+ * `Cursor.extend(...) ` made public (from `_extend `)
81
+ * `Cursor.raise_error(...) ` replaces `_error ` (now public)
82
+ * Improved wait/timeout behavior and state tracking
83
+ * **CLI **:
84
+ * Subcommand name standardized to `index-rebuild ` (was `index_rebuild `)
85
+ * Logging unified; progress reporting moved to logger-based updates
86
+ * **Build/Tooling **:
87
+ * Replaced `setup.py `/`requirements.txt ` with Poetry; consistent formatting (black) and linting (flake8, pylint)
88
+ * Updated supported Python versions; CI matrix adjusted
46
89
47
90
Fixed
48
91
~~~~~
49
92
50
- * Fixed a potential "no-member" error of `RqlBoolOperatorQuery `
51
- * Fixed variety of quality issues in `ast ` module
93
+ * Binary response parsing in network layer (`encoder.py `, `net.py `)
94
+ * Numerous linter and mypy findings across `ast `, `net `, and CLI modules
95
+ * Circular import issues and import path clean-ups
96
+ * Error propagation and context in async operations
97
+ * Potential memory leaks in connection handling and cursors
52
98
53
99
Removed
54
100
~~~~~~~
55
101
56
- * Errors are not re-exported as `__all__ ` for `rethinkdb `
57
- * Removed `Rql* ` aliases for `Reql* ` exceptions
58
- * Removed `auth_key ` in favor of `password ` in connection params
102
+ * Python 2 support dropped completely
103
+ * Legacy CLI scripts removed; replaced by Click-based `rethinkdb/cli/* `
104
+ * Deprecated modules removed:
105
+ * `rethinkdb/backports/* ` (SSL hostname matching backports)
106
+ * `rethinkdb/logger.py `, `rethinkdb/helpers.py `, `rethinkdb/docs.py `
107
+ * Old dependencies and tooling removed (bandit, legacy CI scripts)
108
+ * Travis CI replaced with GitHub Actions
109
+ * `setup.py ` and `requirements.txt ` removed in favor of `pyproject.toml ` and Poetry lockfile
110
+ * Top-level re-export of errors via package `__all__ ` removed; import from `rethinkdb.errors ` instead
111
+ * `auth_key ` parameter removed in favor of `password ` for connections
112
+ * `Rql* ` exception aliases removed (use `Reql* `)
113
+
114
+ Deprecated
115
+ ~~~~~~~~~~
116
+
117
+ * `ReqlQuery.to_json_string() ` is an alias for `to_json() ` and will be removed in a future release
118
+
119
+ Migration Guide
120
+ ~~~~~~~~~~~~~~
121
+
122
+ For users upgrading from 2.4.x to 2.5.0:
123
+
124
+ 1. **Python **: Use Python 3.7+.
125
+ 2. **Imports **: Update imports for moved modules (e.g., utilities now in `rethinkdb.utils `).
126
+ 3. **Exceptions **: Replace `Rql* ` with `Reql* `. Adjust error handling for `ReqlAuthError `/`ReqlTimeoutError ` host/port validation.
127
+ 4. **Handshake **: If customizing JSON encoding/decoding during handshake, pass `json_encoder `/`json_decoder ` to `HandshakeV1_0 `.
128
+ 5. **CLI **: Use `index-rebuild ` (hyphen), and the standardized flags listed above.
129
+ 6. **Connection/Cursor **: Use public `Connection.resume `, `Connection.stop `, `Cursor.extend `, and `Cursor.raise_error `.
130
+ 7. **Queries **: If relying on `optargs `, update to `kwargs `. Prefer `to_json() ` over `to_json_string() `.
59
131
60
132
.. EXAMPLE CHANGELOG ENTRY
61
133
0 commit comments