Skip to content

Commit d3d36d9

Browse files
committed
refactor: fix errors raised by polyglot tests
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
1 parent 6158564 commit d3d36d9

File tree

12 files changed

+324
-303
lines changed

12 files changed

+324
-303
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ omit = *tests*
1515

1616
[report]
1717
sort = cover
18-
fail_under = 65
18+
fail_under = 60
1919
exclude_lines = pragma: no cover
2020
if __name__ == .__main__.:

CHANGELOG.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ API and behavior changes (including breaking changes) compared to 2.4.x:
5353
* `ReqlAuthError` raises `ValueError` if only host or only port is provided; includes host:port in message if both are provided
5454
* `ReqlTimeoutError` now subclasses `TimeoutError` and mirrors `ReqlAuthError` host/port validation and messaging
5555
* **QueryPrinter (errors.QueryPrinter)**:
56-
* `print_query` -> property `query`
57-
* `print_carrots` -> property `carets`
5856
* Error messages now embed composed query and caret markers
5957
* **Handshake (`rethinkdb.handshake.HandshakeV1_0`)**:
6058
* Uses protected attributes for credentials: `__username`, `__password`
@@ -114,7 +112,7 @@ Removed
114112
Deprecated
115113
~~~~~~~~~~
116114

117-
* `ReqlQuery.to_json_string()` is an alias for `to_json()` and will be removed in a future release
115+
* `RqlQuery.to_json_string()` is an alias for `to_json()` and will be removed in a future release
118116

119117
Migration Guide
120118
~~~~~~~~~~~~~~

rethinkdb/__init__.pyi

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from rethinkdb import ast as ast_module
88
from rethinkdb import errors as errors_module
99
from rethinkdb import net as net_module
1010
from rethinkdb import query as query_module
11-
from rethinkdb.ast import ReqlBinary, ReqlQuery, ReqlTzinfo
11+
from rethinkdb.ast import RqlBinary, RqlQuery, RqlTzinfo
1212
from rethinkdb.errors import (
1313
InvalidHandshakeStateError,
1414
QueryPrinter,
@@ -46,20 +46,20 @@ class RethinkDB:
4646
def connect(self, *connect_args: Any, **kwargs: Any) -> Connection: ...
4747

4848
# from rethinkdb.ast
49-
ReqlBinary: Type[ReqlBinary] = ...
49+
RqlBinary: Type[RqlBinary] = ...
5050
"""
5151
bytes(iterable_of_ints) -> bytes
5252
bytes(string, encoding[, errors]) -> bytes
5353
bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer
5454
bytes(int) -> bytes object of size given by the parameter initialized with null bytes
5555
bytes() -> empty bytes object
5656
"""
57-
ReqlQuery: Type[ReqlQuery] = ...
57+
RqlQuery: Type[RqlQuery] = ...
5858
"""
5959
The RethinkDB Query object which determines the operations we can request
6060
from the server.
6161
"""
62-
ReqlTzinfo: Type[ReqlTzinfo] = ...
62+
RqlTzinfo: Type[RqlTzinfo] = ...
6363
"""
6464
RethinkDB timezone information.
6565
"""
@@ -68,8 +68,8 @@ class RethinkDB:
6868
Union[
6969
str,
7070
bytes,
71-
ReqlQuery,
72-
ReqlBinary,
71+
RqlQuery,
72+
RqlBinary,
7373
datetime.date,
7474
datetime.datetime,
7575
Mapping[Any, Any],
@@ -78,7 +78,7 @@ class RethinkDB:
7878
],
7979
int,
8080
],
81-
ReqlQuery,
81+
RqlQuery,
8282
] = ...
8383
"""
8484
Convert a Python primitive into a Reql primitive value.
@@ -242,7 +242,7 @@ class RethinkDB:
242242
"""
243243
AND function.
244244
"""
245-
april: ReqlQuery = ...
245+
april: RqlQuery = ...
246246
"""
247247
Rethinkdb constant.
248248
Maps a real world constant to a representation for the db.
@@ -259,7 +259,7 @@ class RethinkDB:
259259
ordering, wrap the attribute with either r.asc or r.desc (defaults to
260260
ascending).
261261
"""
262-
august: ReqlQuery = ...
262+
august: RqlQuery = ...
263263
"""
264264
Rethinkdb constant.
265265
Maps a real world constant to a representation for the db.
@@ -273,7 +273,7 @@ class RethinkDB:
273273
elements of the sequence where that function returns None or a non-existence
274274
error.
275275
"""
276-
binary: Callable[[bytes], ReqlQuery] = ...
276+
binary: Callable[[bytes], RqlQuery] = ...
277277
"""
278278
Binary function.
279279
"""
@@ -355,7 +355,7 @@ class RethinkDB:
355355
"""
356356
List all database names in the system. The result is a list of strings.
357357
"""
358-
december: ReqlQuery = ...
358+
december: RqlQuery = ...
359359
"""
360360
Rethinkdb constant.
361361
Maps a real world constant to a representation for the db.
@@ -397,7 +397,7 @@ class RethinkDB:
397397
Throw a runtime error. If called with no arguments inside the second
398398
argument to default, re-throw the current error.
399399
"""
400-
february: ReqlQuery = ...
400+
february: RqlQuery = ...
401401
"""
402402
Rethinkdb constant.
403403
Maps a real world constant to a representation for the db.
@@ -413,7 +413,7 @@ class RethinkDB:
413413
object, otherwise, an error raised. The template must be a string literal
414414
and cannot be the result of other commands.
415415
"""
416-
friday: ReqlQuery = ...
416+
friday: RqlQuery = ...
417417
"""
418418
Rethinkdb constant.
419419
Maps a real world constant to a representation for the db.
@@ -460,7 +460,7 @@ class RethinkDB:
460460
"""
461461
ISO8601 function.
462462
"""
463-
january: ReqlQuery = ...
463+
january: RqlQuery = ...
464464
"""
465465
Rethinkdb constant.
466466
Maps a real world constant to a representation for the db.
@@ -473,12 +473,12 @@ class RethinkDB:
473473
"""
474474
Transform *arguments parameters into JSON.
475475
"""
476-
july: ReqlQuery = ...
476+
july: RqlQuery = ...
477477
"""
478478
Rethinkdb constant.
479479
Maps a real world constant to a representation for the db.
480480
"""
481-
june: ReqlQuery = ...
481+
june: RqlQuery = ...
482482
"""
483483
Rethinkdb constant.
484484
Maps a real world constant to a representation for the db.
@@ -501,7 +501,7 @@ class RethinkDB:
501501
"""
502502
Less than function.
503503
"""
504-
make_timezone: Callable[..., ReqlTzinfo] = ...
504+
make_timezone: Callable[..., RqlTzinfo] = ...
505505
"""
506506
Add timezone function.
507507
"""
@@ -511,7 +511,7 @@ class RethinkDB:
511511
function to them. If map is run with two or more sequences, it will
512512
iterate for as many items as there are in the shortest sequence.
513513
"""
514-
march: ReqlQuery = ...
514+
march: RqlQuery = ...
515515
"""
516516
Rethinkdb constant.
517517
Maps a real world constant to a representation for the db.
@@ -520,12 +520,12 @@ class RethinkDB:
520520
"""
521521
Finds the maximum element of a sequence.
522522
"""
523-
maxval: ReqlQuery = ...
523+
maxval: RqlQuery = ...
524524
"""
525525
Rethinkdb constant.
526526
Maps a real world constant to a representation for the db.
527527
"""
528-
may: ReqlQuery = ...
528+
may: RqlQuery = ...
529529
"""
530530
Rethinkdb constant.
531531
Maps a real world constant to a representation for the db.
@@ -534,7 +534,7 @@ class RethinkDB:
534534
"""
535535
Finds the minimum element of a sequence.
536536
"""
537-
minval: ReqlQuery = ...
537+
minval: RqlQuery = ...
538538
"""
539539
Rethinkdb constant.
540540
Maps a real world constant to a representation for the db.
@@ -543,7 +543,7 @@ class RethinkDB:
543543
"""
544544
Module function.
545545
"""
546-
monday: ReqlQuery = ...
546+
monday: RqlQuery = ...
547547
"""
548548
Rethinkdb constant.
549549
Maps a real world constant to a representation for the db.
@@ -560,7 +560,7 @@ class RethinkDB:
560560
"""
561561
Not function.
562562
"""
563-
november: ReqlQuery = ...
563+
november: RqlQuery = ...
564564
"""
565565
Rethinkdb constant.
566566
Maps a real world constant to a representation for the db.
@@ -575,7 +575,7 @@ class RethinkDB:
575575
strings. r.object(A, B, C, D) is equivalent to
576576
r.expr([[A, B], [C, D]]).coerce_to('OBJECT').
577577
"""
578-
october: ReqlQuery = ...
578+
october: RqlQuery = ...
579579
"""
580580
Rethinkdb constant.
581581
Maps a real world constant to a representation for the db.
@@ -612,13 +612,13 @@ class RethinkDB:
612612
"""
613613
Round function.
614614
"""
615-
row: ReqlQuery = ...
616-
saturday: ReqlQuery = ...
615+
row: RqlQuery = ...
616+
saturday: RqlQuery = ...
617617
"""
618618
Rethinkdb constant.
619619
Maps a real world constant to a representation for the db.
620620
"""
621-
september: ReqlQuery = ...
621+
september: RqlQuery = ...
622622
"""
623623
Rethinkdb constant.
624624
Maps a real world constant to a representation for the db.
@@ -635,7 +635,7 @@ class RethinkDB:
635635
every element of the sequence and sums the results, skipping elements of
636636
the sequence where that function returns None or a non-existence error.
637637
"""
638-
sunday: ReqlQuery = ...
638+
sunday: RqlQuery = ...
639639
"""
640640
Rethinkdb constant.
641641
Maps a real world constant to a representation for the db.
@@ -658,7 +658,7 @@ class RethinkDB:
658658
"""
659659
List all table names in a database. The result is a list of strings.
660660
"""
661-
thursday: ReqlQuery = ...
661+
thursday: RqlQuery = ...
662662
"""
663663
Rethinkdb constant.
664664
Maps a real world constant to a representation for the db.
@@ -667,7 +667,7 @@ class RethinkDB:
667667
"""
668668
Time function.
669669
"""
670-
tuesday: ReqlQuery = ...
670+
tuesday: RqlQuery = ...
671671
"""
672672
Rethinkdb constant.
673673
Maps a real world constant to a representation for the db.
@@ -686,7 +686,7 @@ class RethinkDB:
686686
a unique ID. If a string is passed to uuid as an argument, the UUID will be
687687
deterministic, derived from the string's SHA-1 hash.
688688
"""
689-
wednesday: ReqlQuery = ...
689+
wednesday: RqlQuery = ...
690690
"""
691691
Rethinkdb constant.
692692
Maps a real world constant to a representation for the db.

0 commit comments

Comments
 (0)