Skip to content

Commit 1ac5afa

Browse files
authored
Fix docs build warnings, restore failure on warnings behavior (#954)
* Fail docs build on warnings * Replace union types with | operator * Remove --fail-on-warning arg for testing * Replace optional type with union with none * Revert "Remove --fail-on-warning arg for testing" This reverts commit b1fd349.
1 parent 272653e commit 1ac5afa

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ build:
4040
html:
4141
- |-
4242
/bin/bash --login -c "cd docs && micromamba run -n jupytergis-docs \
43-
python -m sphinx --keep-going --nitpicky --show-traceback --builder html --doctree-dir _build/doctrees --define language=en . \
43+
python -m sphinx --fail-on-warning --keep-going --nitpicky --show-traceback --builder html --doctree-dir _build/doctrees --define language=en . \
4444
$READTHEDOCS_OUTPUT/html"

python/jupytergis_lab/jupytergis_lab/notebook/gis_document.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import logging
55
from pathlib import Path
6-
from typing import Any, Dict, List, Literal, Optional, Union
6+
from typing import Any, Dict, List, Literal, Optional
77
from uuid import uuid4
88
import requests
99

@@ -50,7 +50,7 @@ class GISDocument(CommWidget):
5050

5151
def __init__(
5252
self,
53-
path: Optional[str | Path] = None,
53+
path: str | Path | None = None,
5454
latitude: Optional[float] = None,
5555
longitude: Optional[float] = None,
5656
zoom: Optional[float] = None,
@@ -192,7 +192,7 @@ def add_vectortile_layer(
192192
logical_op: str | None = None,
193193
feature: str | None = None,
194194
operator: str | None = None,
195-
value: Union[str, float, float] | None = None,
195+
value: str | float | float | None = None,
196196
):
197197
"""
198198
Add a Vector Tile Layer to the document.
@@ -249,7 +249,7 @@ def add_geojson_layer(
249249
logical_op: str | None = None,
250250
feature: str | None = None,
251251
operator: str | None = None,
252-
value: Union[str, int, float] | None = None,
252+
value: str | int | float | None = None,
253253
color_expr=None,
254254
):
255255
"""
@@ -554,7 +554,7 @@ def add_geoparquet_layer(
554554
logical_op: str | None = None,
555555
feature: str | None = None,
556556
operator: str | None = None,
557-
value: Union[str, int, float] | None = None,
557+
value: str | int | float | None = None,
558558
color_expr=None,
559559
):
560560
"""
@@ -688,7 +688,7 @@ def add_filter(
688688
logical_op: str,
689689
feature: str,
690690
operator: str,
691-
value: Union[str, int, float],
691+
value: str | int | float,
692692
):
693693
"""
694694
Add a filter to a layer
@@ -734,7 +734,7 @@ def update_filter(
734734
logical_op: str,
735735
feature: str,
736736
operator: str,
737-
value: Union[str, int, float],
737+
value: str | int | float,
738738
):
739739
"""
740740
Update a filter applied to a layer
@@ -854,15 +854,15 @@ class Config:
854854
name: str
855855
type: LayerType
856856
visible: bool
857-
parameters: Union[
858-
IRasterLayer,
859-
IVectorLayer,
860-
IVectorTileLayer,
861-
IHillshadeLayer,
862-
IImageLayer,
863-
IWebGlLayer,
864-
IHeatmapLayer,
865-
]
857+
parameters: (
858+
IRasterLayer
859+
| IVectorLayer
860+
| IVectorTileLayer
861+
| IHillshadeLayer
862+
| IImageLayer
863+
| IWebGlLayer
864+
| IHeatmapLayer
865+
)
866866
_parent = Optional[GISDocument]
867867

868868
def __init__(__pydantic_self__, parent, **data: Any) -> None: # noqa
@@ -877,16 +877,16 @@ class Config:
877877

878878
name: str
879879
type: SourceType
880-
parameters: Union[
881-
IRasterSource,
882-
IVectorTileSource,
883-
IGeoJSONSource,
884-
IImageSource,
885-
IVideoSource,
886-
IGeoTiffSource,
887-
IRasterDemSource,
888-
IGeoParquetSource,
889-
]
880+
parameters: (
881+
IRasterSource
882+
| IVectorTileSource
883+
| IGeoJSONSource
884+
| IImageSource
885+
| IVideoSource
886+
| IGeoTiffSource
887+
| IRasterDemSource
888+
| IGeoParquetSource
889+
)
890890
_parent = Optional[GISDocument]
891891

892892
def __init__(__pydantic_self__, parent, **data: Any) -> None: # noqa

0 commit comments

Comments
 (0)