Skip to content

API docs: fix broken/outdated cross references #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ To construct a :class:`neo4j.Session` use the :meth:`neo4j.Driver.session` metho
``bookmarks``
-------------
Optional :class:`neo4j.Bookmarks`. Use this to causally chain sessions.
See :meth:`Session.last_bookmarks` or :meth:`AsyncSession.last_bookmarks` for
See :meth:`.Session.last_bookmarks` or :meth:`.AsyncSession.last_bookmarks` for
more information.

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

.. Note::

Expand Down Expand Up @@ -1862,8 +1862,6 @@ Server-side errors

* :class:`neo4j.exceptions.TokenExpired`

* :class:`neo4j.exceptions.TokenExpiredRetryable`

* :class:`neo4j.exceptions.Forbidden`

* :class:`neo4j.exceptions.DatabaseError`
Expand Down
6 changes: 3 additions & 3 deletions docs/source/async_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ Async Driver Configuration
driver accepts

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


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

See :class:`BookmarkManager` for more information.
See :class:`.BookmarkManager` for more information.

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

:Type: :data:`None`, :class:`BookmarkManager`, or :class:`AsyncBookmarkManager`
:Type: :data:`None`, :class:`.BookmarkManager`, or :class:`.AsyncBookmarkManager`
:Default: :data:`None`

.. versionchanged:: 5.8 Stabilized from experimental.
Expand Down
25 changes: 14 additions & 11 deletions src/neo4j/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@
class NotificationMinimumSeverity(str, Enum):
"""Filter notifications returned by the server by minimum severity.

Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
:class:`.NotificationMinimumSeverity` value will also accept a string::
Inherits from :class:`str` and :class:`enum.Enum`.
Every driver API accepting a :class:`.NotificationMinimumSeverity` value
will also accept a string::

>>> NotificationMinimumSeverity.OFF == "OFF"
True
Expand Down Expand Up @@ -74,8 +75,8 @@ class NotificationMinimumSeverity(str, Enum):
class NotificationSeverity(str, Enum):
"""Server-side notification severity.

Inherits from :class:`str` and :class:`Enum`. Hence, can also be compared
to its string value::
Inherits from :class:`str` and :class:`enum.Enum`.
Hence, can also be compared to its string value::

>>> NotificationSeverity.WARNING == "WARNING"
True
Expand Down Expand Up @@ -125,8 +126,9 @@ class NotificationSeverity(str, Enum):
class NotificationDisabledCategory(str, Enum):
"""Filter notifications returned by the server by category.

Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
:class:`.NotificationDisabledCategory` value will also accept a string::
Inherits from :class:`str` and :class:`enum.Enum`.
Every driver API accepting a :class:`.NotificationDisabledCategory` value
will also accept a string::

>>> NotificationDisabledCategory.UNRECOGNIZED == "UNRECOGNIZED"
True
Expand Down Expand Up @@ -176,8 +178,8 @@ class NotificationDisabledCategory(str, Enum):
class NotificationCategory(str, Enum):
"""Server-side notification category.

Inherits from :class:`str` and :class:`Enum`. Hence, can also be compared
to its string value::
Inherits from :class:`str` and :class:`enum.Enum`.
Hence, can also be compared to its string value::

>>> NotificationCategory.DEPRECATION == "DEPRECATION"
True
Expand Down Expand Up @@ -211,16 +213,17 @@ class NotificationCategory(str, Enum):
class RoutingControl(str, Enum):
"""Selection which cluster members to route a query connect to.

Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
:class:`.RoutingControl` value will also accept a string
Inherits from :class:`str` and :class:`enum.Enum`.
Every driver API accepting a :class:`.RoutingControl` value will also
accept a string::

>>> RoutingControl.READ == "r"
True
>>> RoutingControl.WRITE == "w"
True

.. seealso::
:attr:`.AsyncDriver.execute_query`, :attr:`.Driver.execute_query`
:meth:`.AsyncDriver.execute_query`, :meth:`.Driver.execute_query`

.. versionadded:: 5.5

Expand Down
6 changes: 3 additions & 3 deletions src/neo4j/_async/auth_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ def bearer(

This factory wraps the provider function in an auth manager
implementation that caches the provides auth info until either the
``ExpiringAuth.expires_at`` is exceeded the server notifies the driver
that the auth info is expired (by returning an error that indicates
that the bearer auth token has expired).
:attr:`.ExpiringAuth.expires_at` is exceeded the server notifies the
driver that the auth info is expired (by returning an error that
indicates that the bearer auth token has expired).

.. warning::

Expand Down
16 changes: 8 additions & 8 deletions src/neo4j/_async/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def bookmark_manager(
internal bookmark set. It will receive the new set of bookmarks
as a :class:`.Bookmarks` object and return :data:`None`.

:returns: A default implementation of :class:`AsyncBookmarkManager`.
:returns: A default implementation of :class:`.AsyncBookmarkManager`.

.. versionadded:: 5.0

Expand Down Expand Up @@ -909,7 +909,7 @@ async def example(driver: neo4j.AsyncDriver) -> neo4j.Record::
def execute_query_bookmark_manager(self) -> AsyncBookmarkManager:
"""The driver's default query bookmark manager.

This is the default :class:`AsyncBookmarkManager` used by
This is the default :class:`.AsyncBookmarkManager` used by
:meth:`.execute_query`. This can be used to causally chain
:meth:`.execute_query` calls and sessions. Example::

Expand Down Expand Up @@ -1089,8 +1089,8 @@ async def supports_multi_db(self) -> bool:
.. note::
Feature support query based solely on the Bolt protocol version.
The feature might still be disabled on the server side even if this
function return :const:`True`. It just guarantees that the driver
won't throw a :exc:`ConfigurationError` when trying to use this
function return :data:`True`. It just guarantees that the driver
won't throw a :exc:`.ConfigurationError` when trying to use this
driver feature.
"""
self._check_state()
Expand Down Expand Up @@ -1141,9 +1141,9 @@ async def verify_authentication(
a member of a cluster and exchange some data. In a cluster, there
is no guarantee about which server will be contacted. If the data
exchange is successful and the authentication information is valid,
:const:`True` is returned. Otherwise, the error will be matched
:data:`True` is returned. Otherwise, the error will be matched
against a list of known authentication errors. If the error is on
that list, :const:`False` is returned indicating that the
that list, :data:`False` is returned indicating that the
authentication information is invalid. Otherwise, the error is
re-raised.

Expand Down Expand Up @@ -1201,8 +1201,8 @@ async def supports_session_auth(self) -> bool:
.. note::
Feature support query based solely on the Bolt protocol version.
The feature might still be disabled on the server side even if this
function return :const:`True`. It just guarantees that the driver
won't throw a :exc:`ConfigurationError` when trying to use this
function return :data:`True`. It just guarantees that the driver
won't throw a :exc:`.ConfigurationError` when trying to use this
driver feature.

.. versionadded:: 5.8
Expand Down
54 changes: 27 additions & 27 deletions src/neo4j/_async/work/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ async def get_two_tx(tx):
was obtained has been closed.

.. versionchanged:: 5.0
Can raise :exc:`ResultConsumedError`.
Can raise :exc:`.ResultConsumedError`.
"""
if self._out_of_scope:
raise ResultConsumedError(self, _RESULT_OUT_OF_SCOPE_ERROR)
Expand Down Expand Up @@ -452,24 +452,24 @@ async def single(self, strict: bool = False) -> t.Optional[Record]:

Calling this method always exhausts the result.

If ``strict`` is :const:`True`, this method will raise an exception if
If ``strict`` is :data:`True`, this method will raise an exception if
there is not exactly one record left.

If ``strict`` is :const:`False`, fewer than one record will make this
If ``strict`` is :data:`False`, fewer than one record will make this
method return :data:`None`, more than one record will make this method
emit a warning and return the first record.

:param strict:
If :const:`True`, raise a :class:`neo4j.ResultNotSingleError`
instead of returning None if there is more than one record or
warning if there are more than 1 record.
:const:`False` by default.
If :data:`True`, raise a :exc:`.ResultNotSingleError` instead of
returning :data:`None` if there is more than one record or warning
if there is more than 1 record.
:data:`False` by default.
:type strict: bool

:returns: the next :class:`neo4j.Record` or :data:`None` if none remain

:warns: if more than one record is available and
``strict`` is :const:`False`
``strict`` is :data:`False`

:raises ResultNotSingleError:
If ``strict=True`` and not exactly one record is available.
Expand All @@ -480,7 +480,7 @@ async def single(self, strict: bool = False) -> t.Optional[Record]:
.. versionchanged:: 5.0

* Added ``strict`` parameter.
* Can raise :exc:`ResultConsumedError`.
* Can raise :exc:`.ResultConsumedError`.
"""
await self._buffer(2)
buffer = self._record_buffer
Expand Down Expand Up @@ -545,7 +545,7 @@ async def peek(self) -> t.Optional[Record]:
consumed.

.. versionchanged:: 5.0
Can raise :exc:`ResultConsumedError`.
Can raise :exc:`.ResultConsumedError`.
"""
await self._buffer(1)
if self._record_buffer:
Expand All @@ -554,14 +554,14 @@ async def peek(self) -> t.Optional[Record]:

@AsyncNonConcurrentMethodChecker.non_concurrent_method
async def graph(self) -> Graph:
"""Turn the result into a :class:`neo4j.Graph`.
"""Turn the result into a :class:`.Graph`.

Return a :class:`neo4j.graph.Graph` instance containing all the graph
objects in the result. This graph will also contain already consumed
records.
Return a :class:`.Graph` instance containing all the graph objects in
the result.
This graph will also contain already consumed records.

After calling this method, the result becomes
detached, buffering all remaining records.
After calling this method, the result becomes detached, buffering all
remaining records.

:returns: a result graph

Expand All @@ -570,7 +570,7 @@ async def graph(self) -> Graph:
consumed.

.. versionchanged:: 5.0
Can raise :exc:`ResultConsumedError`.
Can raise :exc:`.ResultConsumedError`.
"""
await self._buffer_all()
return self._hydration_scope.get_graph()
Expand All @@ -591,7 +591,7 @@ async def value(
consumed.

.. versionchanged:: 5.0
Can raise :exc:`ResultConsumedError`.
Can raise :exc:`.ResultConsumedError`.

.. seealso:: :meth:`.Record.value`
"""
Expand All @@ -612,7 +612,7 @@ async def values(
consumed.

.. versionchanged:: 5.0
Can raise :exc:`ResultConsumedError`.
Can raise :exc:`.ResultConsumedError`.

.. seealso:: :meth:`.Record.values`
"""
Expand Down Expand Up @@ -641,7 +641,7 @@ async def data(self, *keys: _TResultKey) -> t.List[t.Dict[str, t.Any]]:
consumed.

.. versionchanged:: 5.0
Can raise :exc:`ResultConsumedError`.
Can raise :exc:`.ResultConsumedError`.

.. seealso:: :meth:`.Record.data`
"""
Expand Down Expand Up @@ -690,7 +690,7 @@ async def to_df(
for instance will return a DataFrame with two columns: ``n`` and ``m``
and 10 rows.

:param expand: If :const:`True`, some structures in the result will be
:param expand: If :data:`True`, some structures in the result will be
recursively expanded (flattened out into multiple columns) like so
(everything inside ``<...>`` is a placeholder):

Expand Down Expand Up @@ -720,21 +720,21 @@ async def to_df(
* ``<r>->.type`` (str) the relationship's type.
See :attr:`.Relationship.type`.

* :const:`list` objects under any variable ``<l>`` will be expanded
* :class:`list` objects under any variable ``<l>`` will be expanded
into

* ``<l>[].0`` (any) the 1st list element
* ``<l>[].1`` (any) the 2nd list element
* ...

* :const:`dict` objects under any variable ``<d>`` will be expanded
* :class:`dict` objects under any variable ``<d>`` will be expanded
into

* ``<d>{}.<key1>`` (any) the 1st key of the dict
* ``<d>{}.<key2>`` (any) the 2nd key of the dict
* ...

* :const:`list` and :const:`dict` objects are expanded recursively.
* :class:`list` and :class:`dict` objects are expanded recursively.
Example::

variable x: [{"foo": "bar", "baz": [42, 0]}, "foobar"]
Expand All @@ -751,10 +751,10 @@ async def to_df(
* Everything else (including :class:`.Path` objects) will not
be flattened.

:const:`dict` keys and variable names that contain ``.`` or ``\``
:class:`dict` keys and variable names that contain ``.`` or ``\``
will be escaped with a backslash (``\.`` and ``\\`` respectively).
:param parse_dates:
If :const:`True`, columns that exclusively contain
If :data:`True`, columns that exclusively contain
:class:`time.DateTime` objects, :class:`time.Date` objects, or
:data:`None`, will be converted to :class:`pandas.Timestamp`.

Expand Down Expand Up @@ -818,7 +818,7 @@ def closed(self) -> bool:
result cannot be used to acquire further records.

In such case, all methods that need to access the Result's records,
will raise a :exc:`ResultConsumedError` when called.
will raise a :exc:`.ResultConsumedError` when called.

:returns: whether the result is closed.

Expand Down
2 changes: 1 addition & 1 deletion src/neo4j/_async/work/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class AsyncTransaction(AsyncTransactionBase):

Container for multiple Cypher queries to be executed within a single
context. :class:`AsyncTransaction` objects can be used as a context
manager (:py:const:`async with` block) where the transaction is committed
manager (``async with`` block) where the transaction is committed
or rolled back based on whether an exception is raised::

async with await session.begin_transaction() as tx:
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j/_async/work/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async def close(self) -> None:
def closed(self) -> bool:
"""Indicate whether the session has been closed.

:returns: :const:`True` if closed, :const:`False` otherwise.
:returns: :data:`True` if closed, :data:`False` otherwise.
"""
return self._closed

Expand Down
2 changes: 1 addition & 1 deletion src/neo4j/_async_compat/concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AsyncRLock(asyncio.Lock):

.. warning::
In async Python there are no threads. This implementation uses
:meth:`asyncio.current_task()` to determine the owner of the lock. This
:meth:`asyncio.current_task` to determine the owner of the lock. This
means that the owner changes when using :meth:`asyncio.wait_for` or
any other method that wraps the work in a new :class:`asyncio.Task`.
"""
Expand Down
Loading