Skip to content

Commit ec22209

Browse files
AmosAidooalamb
andauthored
Fix documentation warnings and error if anymore occur (#14952)
* feat: treat sphinx-build warnings as errors this should fail during build until warnings are fixed * fix: ./gen is not valid link in current context replaces the link with a code backticks * fix: replace with valid docs.rs link * fix: respect hierarchy from H2 -> H3 * apply prettier fixes * Add build.sh to the CI check * tweak * fix * Update spans elsewhere --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 613d925 commit ec22209

File tree

8 files changed

+54
-9
lines changed

8 files changed

+54
-9
lines changed

.github/workflows/docs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
118
on:
219
push:
320
branches:

.github/workflows/docs_pr.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
# Tests for Docs that runs on PRs
1819
name: Docs
1920

2021
concurrency:
@@ -48,7 +49,34 @@ jobs:
4849
uses: ./.github/actions/setup-builder
4950
with:
5051
rust-version: stable
51-
- name: Run doctests
52+
- name: Run doctests (embedded rust examples)
5253
run: cargo test --doc --features avro,json
5354
- name: Verify Working Directory Clean
5455
run: git diff --exit-code
56+
57+
# Test doc build
58+
linux-test-doc-build:
59+
name: Test doc build
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
with:
64+
submodules: true
65+
fetch-depth: 1
66+
- name: Setup Python
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: "3.12"
70+
- name: Install doc dependencies
71+
run: |
72+
set -x
73+
python3 -m venv venv
74+
source venv/bin/activate
75+
pip install -r docs/requirements.txt
76+
- name: Build docs html and check for warnings
77+
run: |
78+
set -x
79+
source venv/bin/activate
80+
cd docs
81+
./build.sh # fails on errors
82+

datafusion/common/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ config_namespace! {
253253
pub support_varchar_with_length: bool, default = true
254254

255255
/// When set to true, the source locations relative to the original SQL
256-
/// query (i.e. [`Span`](sqlparser::tokenizer::Span)) will be collected
256+
/// query (i.e. [`Span`](https://docs.rs/sqlparser/latest/sqlparser/tokenizer/struct.Span.html)) will be collected
257257
/// and recorded in the logical plan nodes.
258258
pub collect_spans: bool, default = false
259259

datafusion/sqllogictest/test_files/information_schema.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ datafusion.optimizer.repartition_sorts true Should DataFusion execute sorts in a
355355
datafusion.optimizer.repartition_windows true Should DataFusion repartition data using the partitions keys to execute window functions in parallel using the provided `target_partitions` level
356356
datafusion.optimizer.skip_failed_rules false When set to true, the logical plan optimizer will produce warning messages if any optimization rules produce errors and then proceed to the next rule. When set to false, any rules that produce errors will cause the query to fail
357357
datafusion.optimizer.top_down_join_key_reordering true When set to true, the physical plan optimizer will run a top down process to reorder the join keys
358-
datafusion.sql_parser.collect_spans false When set to true, the source locations relative to the original SQL query (i.e. [`Span`](sqlparser::tokenizer::Span)) will be collected and recorded in the logical plan nodes.
358+
datafusion.sql_parser.collect_spans false When set to true, the source locations relative to the original SQL query (i.e. [`Span`](https://docs.rs/sqlparser/latest/sqlparser/tokenizer/struct.Span.html)) will be collected and recorded in the logical plan nodes.
359359
datafusion.sql_parser.dialect generic Configure the SQL dialect used by DataFusion's parser; supported values include: Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, Ansi, DuckDB and Databricks.
360360
datafusion.sql_parser.enable_ident_normalization true When set to true, SQL parser will normalize ident (convert ident to lowercase when not quoted)
361361
datafusion.sql_parser.enable_options_value_normalization false When set to true, SQL parser will normalize options value (convert value to lowercase). Note that this option is ignored and will be removed in the future. All case-insensitive values are normalized automatically.

docs/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ sed -i -e 's/\.\.\/\.\.\/\.\.\//https:\/\/github.com\/apache\/arrow-datafusion\/
2828

2929
python rustdoc_trim.py
3030

31-
make SOURCEDIR=`pwd`/temp html
31+
make SOURCEDIR=`pwd`/temp SPHINXOPTS=-W html

docs/source/contributor-guide/howtos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ taplo fmt
141141

142142
## How to update protobuf/gen dependencies
143143

144-
The prost/tonic code can be generated by running `./regen.sh`, which in turn invokes the Rust binary located in [gen](./gen)
144+
The prost/tonic code can be generated by running `./regen.sh`, which in turn invokes the Rust binary located in `./gen`
145145

146-
This is necessary after modifying the protobuf definitions or altering the dependencies of [gen](./gen), and requires a
146+
This is necessary after modifying the protobuf definitions or altering the dependencies of `./gen`, and requires a
147147
valid installation of [protoc] (see [installation instructions] for details).
148148

149149
```bash

docs/source/library-user-guide/query-optimizer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ interval arithmetic to take an expression such as `a > 2500 AND a <= 5000` and
401401
build an accurate selectivity estimate that can then be used to find more efficient
402402
plans.
403403

404-
#### `AnalysisContext` API
404+
### `AnalysisContext` API
405405

406406
The `AnalysisContext` serves as a shared knowledge base during expression evaluation
407407
and boundary analysis. Think of it as a dynamic repository that maintains information about:
@@ -414,7 +414,7 @@ What makes `AnalysisContext` particularly powerful is its ability to propagate i
414414
through the expression tree. As each node in the expression tree is analyzed, it can both
415415
read from and write to this shared context, allowing for sophisticated boundary analysis and inference.
416416

417-
#### `ColumnStatistics` for Cardinality Estimation
417+
### `ColumnStatistics` for Cardinality Estimation
418418

419419
Column statistics form the foundation of optimization decisions. Rather than just tracking
420420
simple metrics, DataFusion's `ColumnStatistics` provides a rich set of information including:

docs/source/user-guide/configs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ Environment variables are read during `SessionConfig` initialisation so they mus
127127
| datafusion.sql_parser.enable_options_value_normalization | false | When set to true, SQL parser will normalize options value (convert value to lowercase). Note that this option is ignored and will be removed in the future. All case-insensitive values are normalized automatically. |
128128
| datafusion.sql_parser.dialect | generic | Configure the SQL dialect used by DataFusion's parser; supported values include: Generic, MySQL, PostgreSQL, Hive, SQLite, Snowflake, Redshift, MsSQL, ClickHouse, BigQuery, Ansi, DuckDB and Databricks. |
129129
| datafusion.sql_parser.support_varchar_with_length | true | If true, permit lengths for `VARCHAR` such as `VARCHAR(20)`, but ignore the length. If false, error if a `VARCHAR` with a length is specified. The Arrow type system does not have a notion of maximum string length and thus DataFusion can not enforce such limits. |
130-
| datafusion.sql_parser.collect_spans | false | When set to true, the source locations relative to the original SQL query (i.e. [`Span`](sqlparser::tokenizer::Span)) will be collected and recorded in the logical plan nodes. |
130+
| datafusion.sql_parser.collect_spans | false | When set to true, the source locations relative to the original SQL query (i.e. [`Span`](https://docs.rs/sqlparser/latest/sqlparser/tokenizer/struct.Span.html)) will be collected and recorded in the logical plan nodes. |
131131
| datafusion.sql_parser.recursion_limit | 50 | Specifies the recursion depth limit when parsing complex SQL Queries |

0 commit comments

Comments
 (0)