33import json
44import logging
55from pathlib import Path
6- from typing import Any , Dict , List , Literal , Optional , Union
6+ from typing import Any , Dict , List , Literal , Optional
77from uuid import uuid4
88import 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