Skip to content

Commit fe3fa9a

Browse files
authored
API docs: fix broken/outdated cross references (#1021)
1 parent a9d40af commit fe3fa9a

21 files changed

+128
-133
lines changed

docs/source/api.rst

+2-4
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ To construct a :class:`neo4j.Session` use the :meth:`neo4j.Driver.session` metho
896896
``bookmarks``
897897
-------------
898898
Optional :class:`neo4j.Bookmarks`. Use this to causally chain sessions.
899-
See :meth:`Session.last_bookmarks` or :meth:`AsyncSession.last_bookmarks` for
899+
See :meth:`.Session.last_bookmarks` or :meth:`.AsyncSession.last_bookmarks` for
900900
more information.
901901

902902
:Default: :data:`None`
@@ -984,7 +984,7 @@ Specifically, the following applies:
984984
Name of the user to impersonate.
985985
This means that all actions in the session will be executed in the security
986986
context of the impersonated user. For this, the user for which the
987-
:class:`Driver` has been created needs to have the appropriate permissions.
987+
:class:`.Driver` has been created needs to have the appropriate permissions.
988988

989989
.. Note::
990990

@@ -1862,8 +1862,6 @@ Server-side errors
18621862

18631863
* :class:`neo4j.exceptions.TokenExpired`
18641864

1865-
* :class:`neo4j.exceptions.TokenExpiredRetryable`
1866-
18671865
* :class:`neo4j.exceptions.Forbidden`
18681866

18691867
* :class:`neo4j.exceptions.DatabaseError`

docs/source/async_api.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ Async Driver Configuration
381381
driver accepts
382382

383383
* a sync as well as an async custom resolver function (see :ref:`async-resolver-ref`)
384-
* as sync as well as an async auth token manager (see :class:`neo4j.AsyncAuthManager`).
384+
* as sync as well as an async auth token manager (see :class:`.AsyncAuthManager`).
385385

386386

387387
.. _async-resolver-ref:
@@ -643,7 +643,7 @@ accepts either a :class:`neo4j.api.BookmarkManager` object or a
643643
Specify a bookmark manager for the driver to use. If present, the bookmark
644644
manager is used to keep all work on the driver causally consistent.
645645

646-
See :class:`BookmarkManager` for more information.
646+
See :class:`.BookmarkManager` for more information.
647647

648648
.. warning::
649649
Enabling the BookmarkManager can have a negative impact on performance since
@@ -654,7 +654,7 @@ See :class:`BookmarkManager` for more information.
654654
group a series of queries together that will be causally chained
655655
automatically.
656656

657-
:Type: :data:`None`, :class:`BookmarkManager`, or :class:`AsyncBookmarkManager`
657+
:Type: :data:`None`, :class:`.BookmarkManager`, or :class:`.AsyncBookmarkManager`
658658
:Default: :data:`None`
659659

660660
.. versionchanged:: 5.8 Stabilized from experimental.

src/neo4j/_api.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
class NotificationMinimumSeverity(str, Enum):
3838
"""Filter notifications returned by the server by minimum severity.
3939
40-
Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
41-
:class:`.NotificationMinimumSeverity` value will also accept a string::
40+
Inherits from :class:`str` and :class:`enum.Enum`.
41+
Every driver API accepting a :class:`.NotificationMinimumSeverity` value
42+
will also accept a string::
4243
4344
>>> NotificationMinimumSeverity.OFF == "OFF"
4445
True
@@ -74,8 +75,8 @@ class NotificationMinimumSeverity(str, Enum):
7475
class NotificationSeverity(str, Enum):
7576
"""Server-side notification severity.
7677
77-
Inherits from :class:`str` and :class:`Enum`. Hence, can also be compared
78-
to its string value::
78+
Inherits from :class:`str` and :class:`enum.Enum`.
79+
Hence, can also be compared to its string value::
7980
8081
>>> NotificationSeverity.WARNING == "WARNING"
8182
True
@@ -125,8 +126,9 @@ class NotificationSeverity(str, Enum):
125126
class NotificationDisabledCategory(str, Enum):
126127
"""Filter notifications returned by the server by category.
127128
128-
Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
129-
:class:`.NotificationDisabledCategory` value will also accept a string::
129+
Inherits from :class:`str` and :class:`enum.Enum`.
130+
Every driver API accepting a :class:`.NotificationDisabledCategory` value
131+
will also accept a string::
130132
131133
>>> NotificationDisabledCategory.UNRECOGNIZED == "UNRECOGNIZED"
132134
True
@@ -176,8 +178,8 @@ class NotificationDisabledCategory(str, Enum):
176178
class NotificationCategory(str, Enum):
177179
"""Server-side notification category.
178180
179-
Inherits from :class:`str` and :class:`Enum`. Hence, can also be compared
180-
to its string value::
181+
Inherits from :class:`str` and :class:`enum.Enum`.
182+
Hence, can also be compared to its string value::
181183
182184
>>> NotificationCategory.DEPRECATION == "DEPRECATION"
183185
True
@@ -211,16 +213,17 @@ class NotificationCategory(str, Enum):
211213
class RoutingControl(str, Enum):
212214
"""Selection which cluster members to route a query connect to.
213215
214-
Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
215-
:class:`.RoutingControl` value will also accept a string
216+
Inherits from :class:`str` and :class:`enum.Enum`.
217+
Every driver API accepting a :class:`.RoutingControl` value will also
218+
accept a string::
216219
217220
>>> RoutingControl.READ == "r"
218221
True
219222
>>> RoutingControl.WRITE == "w"
220223
True
221224
222225
.. seealso::
223-
:attr:`.AsyncDriver.execute_query`, :attr:`.Driver.execute_query`
226+
:meth:`.AsyncDriver.execute_query`, :meth:`.Driver.execute_query`
224227
225228
.. versionadded:: 5.5
226229

src/neo4j/_async/auth_management.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ def bearer(
222222
223223
This factory wraps the provider function in an auth manager
224224
implementation that caches the provides auth info until either the
225-
``ExpiringAuth.expires_at`` is exceeded the server notifies the driver
226-
that the auth info is expired (by returning an error that indicates
227-
that the bearer auth token has expired).
225+
:attr:`.ExpiringAuth.expires_at` is exceeded the server notifies the
226+
driver that the auth info is expired (by returning an error that
227+
indicates that the bearer auth token has expired).
228228
229229
.. warning::
230230

src/neo4j/_async/driver.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def bookmark_manager(
344344
internal bookmark set. It will receive the new set of bookmarks
345345
as a :class:`.Bookmarks` object and return :data:`None`.
346346
347-
:returns: A default implementation of :class:`AsyncBookmarkManager`.
347+
:returns: A default implementation of :class:`.AsyncBookmarkManager`.
348348
349349
.. versionadded:: 5.0
350350
@@ -909,7 +909,7 @@ async def example(driver: neo4j.AsyncDriver) -> neo4j.Record::
909909
def execute_query_bookmark_manager(self) -> AsyncBookmarkManager:
910910
"""The driver's default query bookmark manager.
911911
912-
This is the default :class:`AsyncBookmarkManager` used by
912+
This is the default :class:`.AsyncBookmarkManager` used by
913913
:meth:`.execute_query`. This can be used to causally chain
914914
:meth:`.execute_query` calls and sessions. Example::
915915
@@ -1089,8 +1089,8 @@ async def supports_multi_db(self) -> bool:
10891089
.. note::
10901090
Feature support query based solely on the Bolt protocol version.
10911091
The feature might still be disabled on the server side even if this
1092-
function return :const:`True`. It just guarantees that the driver
1093-
won't throw a :exc:`ConfigurationError` when trying to use this
1092+
function return :data:`True`. It just guarantees that the driver
1093+
won't throw a :exc:`.ConfigurationError` when trying to use this
10941094
driver feature.
10951095
"""
10961096
self._check_state()
@@ -1141,9 +1141,9 @@ async def verify_authentication(
11411141
a member of a cluster and exchange some data. In a cluster, there
11421142
is no guarantee about which server will be contacted. If the data
11431143
exchange is successful and the authentication information is valid,
1144-
:const:`True` is returned. Otherwise, the error will be matched
1144+
:data:`True` is returned. Otherwise, the error will be matched
11451145
against a list of known authentication errors. If the error is on
1146-
that list, :const:`False` is returned indicating that the
1146+
that list, :data:`False` is returned indicating that the
11471147
authentication information is invalid. Otherwise, the error is
11481148
re-raised.
11491149
@@ -1201,8 +1201,8 @@ async def supports_session_auth(self) -> bool:
12011201
.. note::
12021202
Feature support query based solely on the Bolt protocol version.
12031203
The feature might still be disabled on the server side even if this
1204-
function return :const:`True`. It just guarantees that the driver
1205-
won't throw a :exc:`ConfigurationError` when trying to use this
1204+
function return :data:`True`. It just guarantees that the driver
1205+
won't throw a :exc:`.ConfigurationError` when trying to use this
12061206
driver feature.
12071207
12081208
.. versionadded:: 5.8

src/neo4j/_async/work/result.py

+27-27
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ async def get_two_tx(tx):
424424
was obtained has been closed.
425425
426426
.. versionchanged:: 5.0
427-
Can raise :exc:`ResultConsumedError`.
427+
Can raise :exc:`.ResultConsumedError`.
428428
"""
429429
if self._out_of_scope:
430430
raise ResultConsumedError(self, _RESULT_OUT_OF_SCOPE_ERROR)
@@ -452,24 +452,24 @@ async def single(self, strict: bool = False) -> t.Optional[Record]:
452452
453453
Calling this method always exhausts the result.
454454
455-
If ``strict`` is :const:`True`, this method will raise an exception if
455+
If ``strict`` is :data:`True`, this method will raise an exception if
456456
there is not exactly one record left.
457457
458-
If ``strict`` is :const:`False`, fewer than one record will make this
458+
If ``strict`` is :data:`False`, fewer than one record will make this
459459
method return :data:`None`, more than one record will make this method
460460
emit a warning and return the first record.
461461
462462
:param strict:
463-
If :const:`True`, raise a :class:`neo4j.ResultNotSingleError`
464-
instead of returning None if there is more than one record or
465-
warning if there are more than 1 record.
466-
:const:`False` by default.
463+
If :data:`True`, raise a :exc:`.ResultNotSingleError` instead of
464+
returning :data:`None` if there is more than one record or warning
465+
if there is more than 1 record.
466+
:data:`False` by default.
467467
:type strict: bool
468468
469469
:returns: the next :class:`neo4j.Record` or :data:`None` if none remain
470470
471471
:warns: if more than one record is available and
472-
``strict`` is :const:`False`
472+
``strict`` is :data:`False`
473473
474474
:raises ResultNotSingleError:
475475
If ``strict=True`` and not exactly one record is available.
@@ -480,7 +480,7 @@ async def single(self, strict: bool = False) -> t.Optional[Record]:
480480
.. versionchanged:: 5.0
481481
482482
* Added ``strict`` parameter.
483-
* Can raise :exc:`ResultConsumedError`.
483+
* Can raise :exc:`.ResultConsumedError`.
484484
"""
485485
await self._buffer(2)
486486
buffer = self._record_buffer
@@ -545,7 +545,7 @@ async def peek(self) -> t.Optional[Record]:
545545
consumed.
546546
547547
.. versionchanged:: 5.0
548-
Can raise :exc:`ResultConsumedError`.
548+
Can raise :exc:`.ResultConsumedError`.
549549
"""
550550
await self._buffer(1)
551551
if self._record_buffer:
@@ -554,14 +554,14 @@ async def peek(self) -> t.Optional[Record]:
554554

555555
@AsyncNonConcurrentMethodChecker.non_concurrent_method
556556
async def graph(self) -> Graph:
557-
"""Turn the result into a :class:`neo4j.Graph`.
557+
"""Turn the result into a :class:`.Graph`.
558558
559-
Return a :class:`neo4j.graph.Graph` instance containing all the graph
560-
objects in the result. This graph will also contain already consumed
561-
records.
559+
Return a :class:`.Graph` instance containing all the graph objects in
560+
the result.
561+
This graph will also contain already consumed records.
562562
563-
After calling this method, the result becomes
564-
detached, buffering all remaining records.
563+
After calling this method, the result becomes detached, buffering all
564+
remaining records.
565565
566566
:returns: a result graph
567567
@@ -570,7 +570,7 @@ async def graph(self) -> Graph:
570570
consumed.
571571
572572
.. versionchanged:: 5.0
573-
Can raise :exc:`ResultConsumedError`.
573+
Can raise :exc:`.ResultConsumedError`.
574574
"""
575575
await self._buffer_all()
576576
return self._hydration_scope.get_graph()
@@ -591,7 +591,7 @@ async def value(
591591
consumed.
592592
593593
.. versionchanged:: 5.0
594-
Can raise :exc:`ResultConsumedError`.
594+
Can raise :exc:`.ResultConsumedError`.
595595
596596
.. seealso:: :meth:`.Record.value`
597597
"""
@@ -612,7 +612,7 @@ async def values(
612612
consumed.
613613
614614
.. versionchanged:: 5.0
615-
Can raise :exc:`ResultConsumedError`.
615+
Can raise :exc:`.ResultConsumedError`.
616616
617617
.. seealso:: :meth:`.Record.values`
618618
"""
@@ -641,7 +641,7 @@ async def data(self, *keys: _TResultKey) -> t.List[t.Dict[str, t.Any]]:
641641
consumed.
642642
643643
.. versionchanged:: 5.0
644-
Can raise :exc:`ResultConsumedError`.
644+
Can raise :exc:`.ResultConsumedError`.
645645
646646
.. seealso:: :meth:`.Record.data`
647647
"""
@@ -690,7 +690,7 @@ async def to_df(
690690
for instance will return a DataFrame with two columns: ``n`` and ``m``
691691
and 10 rows.
692692
693-
:param expand: If :const:`True`, some structures in the result will be
693+
:param expand: If :data:`True`, some structures in the result will be
694694
recursively expanded (flattened out into multiple columns) like so
695695
(everything inside ``<...>`` is a placeholder):
696696
@@ -720,21 +720,21 @@ async def to_df(
720720
* ``<r>->.type`` (str) the relationship's type.
721721
See :attr:`.Relationship.type`.
722722
723-
* :const:`list` objects under any variable ``<l>`` will be expanded
723+
* :class:`list` objects under any variable ``<l>`` will be expanded
724724
into
725725
726726
* ``<l>[].0`` (any) the 1st list element
727727
* ``<l>[].1`` (any) the 2nd list element
728728
* ...
729729
730-
* :const:`dict` objects under any variable ``<d>`` will be expanded
730+
* :class:`dict` objects under any variable ``<d>`` will be expanded
731731
into
732732
733733
* ``<d>{}.<key1>`` (any) the 1st key of the dict
734734
* ``<d>{}.<key2>`` (any) the 2nd key of the dict
735735
* ...
736736
737-
* :const:`list` and :const:`dict` objects are expanded recursively.
737+
* :class:`list` and :class:`dict` objects are expanded recursively.
738738
Example::
739739
740740
variable x: [{"foo": "bar", "baz": [42, 0]}, "foobar"]
@@ -751,10 +751,10 @@ async def to_df(
751751
* Everything else (including :class:`.Path` objects) will not
752752
be flattened.
753753
754-
:const:`dict` keys and variable names that contain ``.`` or ``\``
754+
:class:`dict` keys and variable names that contain ``.`` or ``\``
755755
will be escaped with a backslash (``\.`` and ``\\`` respectively).
756756
:param parse_dates:
757-
If :const:`True`, columns that exclusively contain
757+
If :data:`True`, columns that exclusively contain
758758
:class:`time.DateTime` objects, :class:`time.Date` objects, or
759759
:data:`None`, will be converted to :class:`pandas.Timestamp`.
760760
@@ -818,7 +818,7 @@ def closed(self) -> bool:
818818
result cannot be used to acquire further records.
819819
820820
In such case, all methods that need to access the Result's records,
821-
will raise a :exc:`ResultConsumedError` when called.
821+
will raise a :exc:`.ResultConsumedError` when called.
822822
823823
:returns: whether the result is closed.
824824

src/neo4j/_async/work/transaction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class AsyncTransaction(AsyncTransactionBase):
241241
242242
Container for multiple Cypher queries to be executed within a single
243243
context. :class:`AsyncTransaction` objects can be used as a context
244-
manager (:py:const:`async with` block) where the transaction is committed
244+
manager (``async with`` block) where the transaction is committed
245245
or rolled back based on whether an exception is raised::
246246
247247
async with await session.begin_transaction() as tx:

src/neo4j/_async/work/workspace.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ async def close(self) -> None:
201201
def closed(self) -> bool:
202202
"""Indicate whether the session has been closed.
203203
204-
:returns: :const:`True` if closed, :const:`False` otherwise.
204+
:returns: :data:`True` if closed, :data:`False` otherwise.
205205
"""
206206
return self._closed
207207

src/neo4j/_async_compat/concurrency.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AsyncRLock(asyncio.Lock):
5353
5454
.. warning::
5555
In async Python there are no threads. This implementation uses
56-
:meth:`asyncio.current_task()` to determine the owner of the lock. This
56+
:meth:`asyncio.current_task` to determine the owner of the lock. This
5757
means that the owner changes when using :meth:`asyncio.wait_for` or
5858
any other method that wraps the work in a new :class:`asyncio.Task`.
5959
"""

0 commit comments

Comments
 (0)