refactor(cli): target ruff 310 (#32985)

Use union types for optional parameters
This commit is contained in:
Mason Daugherty
2025-09-16 22:04:28 -04:00
committed by GitHub
parent ab1b822523
commit 66041a2778
5 changed files with 27 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ import re
import shutil
import subprocess
from pathlib import Path
from typing import Annotated, Optional, cast
from typing import Annotated, cast
import typer
from typing_extensions import TypedDict
@@ -66,14 +66,14 @@ def new(
),
],
name_class: Annotated[
Optional[str],
str | None,
typer.Option(
help="The name of the integration in PascalCase. e.g. `MyIntegration`."
" This is used to name classes like `MyIntegrationVectorStore`",
),
] = None,
src: Annotated[
Optional[list[str]],
list[str] | None,
typer.Option(
help="The name of the single template file to copy."
" e.g. `--src integration_template/chat_models.py "
@@ -81,7 +81,7 @@ def new(
),
] = None,
dst: Annotated[
Optional[list[str]],
list[str] | None,
typer.Option(
help="The relative path to the integration package to place the new file in"
". e.g. `my-integration/my_integration.py`",
@@ -220,7 +220,7 @@ def create_doc(
),
],
name_class: Annotated[
Optional[str],
str | None,
typer.Option(
help=(
"The PascalCase name of the integration (e.g. `OpenAI`, "