88import sys
99from collections .abc import Callable
1010from pathlib import Path
11- from typing import TYPE_CHECKING , Any , Optional
11+ from typing import TYPE_CHECKING , Any
1212
1313import typer
1414import ujson
7878@catch_exception (console = console )
7979def check (
8080 check_name : str = typer .Argument (default = "" , help = "Name of the Python check" ),
81- branch : Optional [ str ] = None ,
81+ branch : str | None = None ,
8282 path : str = typer .Option ("." , help = "Root directory" ),
8383 debug : bool = False ,
8484 format_json : bool = False ,
8585 _ : str = CONFIG_PARAM ,
8686 list_available : bool = typer .Option (False , "--list" , help = "Show available Python checks" ),
87- variables : Optional [ list [str ]] = typer .Argument (
87+ variables : list [str ] | None = typer .Argument (
8888 None , help = "Variables to pass along with the query. Format key=value key=value."
8989 ),
9090) -> None :
@@ -106,12 +106,12 @@ def check(
106106@catch_exception (console = console )
107107async def generator (
108108 generator_name : str = typer .Argument (default = "" , help = "Name of the Generator" ),
109- branch : Optional [ str ] = None ,
109+ branch : str | None = None ,
110110 path : str = typer .Option ("." , help = "Root directory" ),
111111 debug : bool = False ,
112112 _ : str = CONFIG_PARAM ,
113113 list_available : bool = typer .Option (False , "--list" , help = "Show available Generators" ),
114- variables : Optional [ list [str ]] = typer .Argument (
114+ variables : list [str ] | None = typer .Argument (
115115 None , help = "Variables to pass along with the query. Format key=value key=value."
116116 ),
117117) -> None :
@@ -134,13 +134,13 @@ async def run(
134134 debug : bool = False ,
135135 _ : str = CONFIG_PARAM ,
136136 branch : str = typer .Option (None , help = "Branch on which to run the script." ),
137- concurrent : Optional [ int ] = typer .Option (
137+ concurrent : int | None = typer .Option (
138138 None ,
139139 help = "Maximum number of requests to execute at the same time." ,
140140 envvar = "INFRAHUB_MAX_CONCURRENT_EXECUTION" ,
141141 ),
142142 timeout : int = typer .Option (60 , help = "Timeout in sec" , envvar = "INFRAHUB_TIMEOUT" ),
143- variables : Optional [ list [str ]] = typer .Argument (
143+ variables : list [str ] | None = typer .Argument (
144144 None , help = "Variables to pass along with the query. Format key=value key=value."
145145 ),
146146) -> None :
@@ -251,7 +251,7 @@ async def _run_transform(
251251@catch_exception (console = console )
252252async def render (
253253 transform_name : str = typer .Argument (default = "" , help = "Name of the Python transformation" , show_default = False ),
254- variables : Optional [ list [str ]] = typer .Argument (
254+ variables : list [str ] | None = typer .Argument (
255255 None , help = "Variables to pass along with the query. Format key=value key=value."
256256 ),
257257 branch : str = typer .Option (None , help = "Branch on which to render the transform." ),
@@ -301,7 +301,7 @@ async def render(
301301@catch_exception (console = console )
302302def transform (
303303 transform_name : str = typer .Argument (default = "" , help = "Name of the Python transformation" , show_default = False ),
304- variables : Optional [ list [str ]] = typer .Argument (
304+ variables : list [str ] | None = typer .Argument (
305305 None , help = "Variables to pass along with the query. Format key=value key=value."
306306 ),
307307 branch : str = typer .Option (None , help = "Branch on which to run the transformation" ),
0 commit comments