Skip to content

Commit

Permalink
docs: link to Doxygen output instead of using breathe
Browse files Browse the repository at this point in the history
Fixes #1935.
  • Loading branch information
lidavidm committed Sep 27, 2024
1 parent d204b82 commit 491c753
Show file tree
Hide file tree
Showing 29 changed files with 360 additions and 174 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ repos:
name: Ensure CGO adbc.h is syncd
language: script
pass_filenames: true
files: '(c/driver_manager/adbc_driver_manager\.)|(^adbc\.h)'
files: '^c/include/arrow-adbc/.*\.h$'
entry: "./ci/scripts/run_cgo_drivermgr_check.sh"
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
Expand Down
2 changes: 1 addition & 1 deletion c/apidoc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*

EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = ADBC ADBC_DRIVER_MANAGER_H

# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
Expand Down
2 changes: 1 addition & 1 deletion c/include/arrow-adbc/adbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,7 @@ AdbcStatusCode AdbcStatementExecuteQuery(struct AdbcStatement* statement,
/// \since ADBC API revision 1.1.0
///
/// \param[in] statement The statement to execute.
/// \param[out] out The result schema.
/// \param[out] schema The result schema.
/// \param[out] error An optional location to return an error
/// message if necessary.
///
Expand Down
5 changes: 5 additions & 0 deletions c/include/arrow-adbc/adbc_driver_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
// specific language governing permissions and limitations
// under the License.

/// \file arrow-adbc/adbc_driver_manager.h ADBC Driver Manager
///
/// A helper library to dynamically load and use multiple ADBC drivers in the
/// same process.

#pragma once

#include <arrow-adbc/adbc.h>
Expand Down
10 changes: 5 additions & 5 deletions ci/conda_env_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
# specific language governing permissions and limitations
# under the License.

breathe
doxygen
# XXX(https://github.com/apache/arrow-adbc/issues/987)
furo>=2023.09.10
furo
make
# Needed to install mermaid
nodejs
numpydoc
pytest
# XXX: we're stuck until we can get rid of Breathe
sphinx=6.*
# XXX: furo on conda-forge says it isn't compatible with sphinx 8, but in
# reality it is (the conda metadata for one of its dependencies is wrong)
# https://github.com/conda-forge/sphinx-basic-ng-feedstock/pull/11
sphinx >=7
sphinx-autobuild
sphinx-copybutton
sphinx-design
Expand Down
14 changes: 12 additions & 2 deletions ci/scripts/docs_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,27 @@ main() {

pushd "$source_dir/docs"
# The project name/version don't really matter here.
python "$source_dir/docs/source/ext/doxygen_inventory.py" \
"ADBC C" \
"version" \
--html-path "$source_dir/c/apidoc/html" \
--xml-path "$source_dir/c/apidoc/xml" \
"cpp/api" \
"$source_dir/c/apidoc"
python "$source_dir/docs/source/ext/javadoc_inventory.py" \
"ADBC" \
"ADBC Java" \
"version" \
"$source_dir/java/target/site/apidocs" \
"java/api"

# We need to determine the base URL without knowing it...
# Inject a dummy URL here, and fix it up in website_build.sh
export ADBC_INTERSPHINX_MAPPING_java_adbc="http://javadocs.home.arpa/;$source_dir/java/target/site/apidocs/objects.inv"
export ADBC_INTERSPHINX_MAPPING_cpp_adbc="http://javadocs.home.arpa/;$source_dir/c/apidoc/objects.inv"

make html
sphinx-build --builder html --nitpicky --fail-on-warning --keep-going source build/html
rm -rf "$source_dir/docs/build/html/cpp/api"
cp -r "$source_dir/c/apidoc/html" "$source_dir/docs/build/html/cpp/api"
rm -rf "$source_dir/docs/build/html/java/api"
cp -r "$source_dir/java/target/site/apidocs" "$source_dir/docs/build/html/java/api"
make doctest
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/run_cgo_drivermgr_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ main() {

for f in "$@"; do
fn=$(basename $f)
if ! diff -q "$f" "go/adbc/drivermgr/$fn" &>/dev/null; then
>&2 echo "OUT OF SYNC: $f differs from go/adbc/drivermgr/$fn"
if ! diff -q "$f" "go/adbc/drivermgr/arrow-adbc/$fn" &>/dev/null; then
>&2 echo "OUT OF SYNC: $f differs from go/adbc/drivermgr/arrow-adbc/$fn"
popd
return 1
fi
Expand Down
12 changes: 0 additions & 12 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"adbc_cookbook",
# generic directives to enable intersphinx for java
"adbc_java_domain",
"breathe",
"numpydoc",
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
Expand Down Expand Up @@ -78,13 +77,6 @@
"show-inheritance": True,
}

# -- Options for Breathe -----------------------------------------------------

breathe_default_project = "adbc"
breathe_projects = {
"adbc": "../../c/apidoc/xml/",
}

# -- Options for doctest -----------------------------------------------------

doctest_global_setup = """
Expand Down Expand Up @@ -132,10 +124,6 @@ def _find_intersphinx_mappings():
url, _, path = val.partition(";")
print("[ADBC] Found Intersphinx mapping", name)
intersphinx_mapping[name] = (url, path)
# "adbc_java": (
# "http://localhost:8000/",
# "/home/lidavidm/Code/arrow-adbc/java/target/site/apidocs/objects.inv",
# ),


_find_intersphinx_mappings()
Expand Down
22 changes: 0 additions & 22 deletions docs/source/cpp/api/adbc.rst

This file was deleted.

22 changes: 0 additions & 22 deletions docs/source/cpp/api/adbc_driver_manager.rst

This file was deleted.

7 changes: 2 additions & 5 deletions docs/source/cpp/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@
C/C++ API Reference
===================

.. toctree::
:maxdepth: 2

adbc
adbc_driver_manager
This is a stub page for the Doxygen documentation. If you're seeing this page,
it means that the actual documentation was not generated.
2 changes: 1 addition & 1 deletion docs/source/cpp/concurrency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AdbcConnection:
/* What happens to the result set of stmt1? */
What happens if the client application calls
:cpp:func:`AdbcStatementExecuteQuery` on ``stmt1``, then on ``stmt2``,
:c:func:`AdbcStatementExecuteQuery` on ``stmt1``, then on ``stmt2``,
without reading the result set of ``stmt1``? Some existing client
libraries/protocols, like libpq, don't support concurrent execution of
queries from a single connection. So the driver would have to
Expand Down
13 changes: 6 additions & 7 deletions docs/source/cpp/driver_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,12 @@ Then they can be used via CMake, e.g.:
Usage
=====

To create a database, use the :cpp:class:`AdbcDatabase` API as usual,
but during initialization, provide two additional parameters in
addition to the driver-specific connection parameters: ``driver`` and
(optionally) ``entrypoint``. ``driver`` must be the name of a library
to load, or the path to a library to load. ``entrypoint``, if
provided, should be the name of the symbol that serves as the ADBC
entrypoint (see :cpp:type:`AdbcDriverInitFunc`).
To create a database, use the :c:struct:`AdbcDatabase` API as usual, but
during initialization, provide two additional parameters in addition to the
driver-specific connection parameters: ``driver`` and (optionally)
``entrypoint``. ``driver`` must be the name of a library to load, or the path
to a library to load. ``entrypoint``, if provided, should be the name of the
symbol that serves as the ADBC entrypoint (see :c:type:`AdbcDriverInitFunc`).

.. code-block:: c
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cpp/recipe/quickstart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int main() {
/// -----------------
///
/// We execute a query by setting the query on the statement, then
/// calling :cpp:func:`AdbcStatementExecuteQuery`. The results come
/// calling :c:func:`AdbcStatementExecuteQuery`. The results come
/// back through the `Arrow C Data Interface`_.
///
/// .. _Arrow C Data Interface: https://arrow.apache.org/docs/format/CDataInterface.html
Expand Down
32 changes: 16 additions & 16 deletions docs/source/driver/flight_sql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Usage
=====

To connect to a database, supply the "uri" parameter when constructing
the :cpp:class:`AdbcDatabase`.
the :c:struct:`AdbcDatabase`.

.. tab-set::

Expand Down Expand Up @@ -183,7 +183,7 @@ few optional authentication schemes:
- An HTTP-style scheme mimicking the Arrow Flight SQL JDBC driver.

Set the options ``username`` and ``password`` on the
:cpp:class:`AdbcDatabase`. Alternatively, set the option
:c:struct:`AdbcDatabase`. Alternatively, set the option
``adbc.flight.sql.authorization_header`` for full control.

The client provides credentials sending an ``authorization`` from
Expand Down Expand Up @@ -272,8 +272,8 @@ Custom Call Headers
-------------------

Custom HTTP headers can be attached to requests via options that apply
to :cpp:class:`AdbcDatabase`, :cpp:class:`AdbcConnection`, and
:cpp:class:`AdbcStatement`.
to :c:struct:`AdbcDatabase`, :c:struct:`AdbcConnection`, and
:c:struct:`AdbcStatement`.

``adbc.flight.sql.rpc.call_header.<HEADER NAME>``
Add the header ``<HEADER NAME>`` to outgoing requests with the given
Expand Down Expand Up @@ -301,7 +301,7 @@ All partitions are fetched in parallel. A limited number of batches
are queued per partition. Data is returned to the client in the order
of the partitions.

Some behavior can be configured on the :cpp:class:`AdbcStatement`:
Some behavior can be configured on the :c:struct:`AdbcStatement`:

``adbc.rpc.result_queue_size``
The number of batches to queue per partition. Defaults to 5.
Expand All @@ -313,27 +313,27 @@ Incremental Execution

By setting :c:macro:`ADBC_STATEMENT_OPTION_INCREMENTAL`, you can use
nonblocking execution with this driver. This changes the behavior of
:func:`AdbcStatementExecutePartitions` only. When enabled, ExecutePartitions
will return every time there are new partitions (in Flight SQL terms, when
there are new FlightEndpoints) from the server, instead of blocking until the
query is complete.
:c:func:`AdbcStatementExecutePartitions` only. When enabled,
ExecutePartitions will return every time there are new partitions (in Flight
SQL terms, when there are new FlightEndpoints) from the server, instead of
blocking until the query is complete.

Some behavior can be configured on the :cpp:class:`AdbcStatement`:
Some behavior can be configured on the :c:struct:`AdbcStatement`:

``adbc.flight.sql.statement.exec.last_flight_info``
Get the serialized bytes for the most recent ``FlightInfo`` returned by
the service. This is a low-level option intended for advanced usage. It
is most useful when incremental execution is enabled, for inspecting the
latest server response without waiting for
:func:`AdbcStatementExecutePartitions` to return.
:c:func:`AdbcStatementExecutePartitions` to return.

Python: :attr:`adbc_driver_flightsql.StatementOptions.LAST_FLIGHT_INFO`

Metadata
--------

The driver currently will not populate column constraint info (foreign
keys, primary keys, etc.) in :cpp:func:`AdbcConnectionGetObjects`.
keys, primary keys, etc.) in :c:func:`AdbcConnectionGetObjects`.
Also, catalog filters are evaluated as simple string matches, not
``LIKE``-style patterns.

Expand Down Expand Up @@ -390,7 +390,7 @@ Timeouts
--------

By default, timeouts are not used for RPC calls. They can be set via
special options on :cpp:class:`AdbcConnection`. In general, it is
special options on :c:struct:`AdbcConnection`. In general, it is
best practice to set timeouts to avoid unexpectedly getting stuck.
The options are as follows:

Expand All @@ -409,7 +409,7 @@ The options are as follows:
calls.

For example, this controls the timeout of the underlying Flight
calls that implement :func:`AdbcStatementExecuteQuery`.
calls that implement :c:func:`AdbcStatementExecuteQuery`.

Python: :attr:`adbc_driver_flightsql.ConnectionOptions.TIMEOUT_QUERY`

Expand All @@ -422,7 +422,7 @@ The options are as follows:

Python: :attr:`adbc_driver_flightsql.ConnectionOptions.TIMEOUT_UPDATE`

There is also a timeout that is set on the :cpp:class:`AdbcDatabase`:
There is also a timeout that is set on the :c:struct:`AdbcDatabase`:

``adbc.flight.sql.rpc.timeout_seconds.connect``
A timeout (in floating-point seconds) for establishing a connection. The
Expand All @@ -434,6 +434,6 @@ Transactions
The driver supports transactions. It will first check the server's
SqlInfo to determine whether this is supported. Otherwise,
transaction-related ADBC APIs will return
:c:type:`ADBC_STATUS_NOT_IMPLEMENTED`.
:c:macro:`ADBC_STATUS_NOT_IMPLEMENTED`.

.. _DBAPI 2.0: https://peps.python.org/pep-0249/
2 changes: 1 addition & 1 deletion docs/source/driver/postgresql.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Usage
=====

To connect to a database, supply the "uri" parameter when constructing
the :cpp:class:`AdbcDatabase`. This should be a `connection URI
the :c:struct:`AdbcDatabase`. This should be a `connection URI
<https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING>`_.

.. tab-set::
Expand Down
Loading

0 comments on commit 491c753

Please sign in to comment.