Skip to content

Commit

Permalink
Remove outdated type hints from review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheffl committed Dec 1, 2024
1 parent 0dc22ee commit e30aa57
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions providers/src/airflow/providers/edge/worker_api/datamodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
from __future__ import annotations

from datetime import datetime
from typing import ( # noqa: UP035 - prevent pytest failing in back-compat
from typing import (
Annotated,
Any,
Dict,
List,
Optional,
Union,
)

from pydantic import BaseModel, Field
Expand Down Expand Up @@ -61,7 +57,7 @@ class JsonRpcRequest(JsonRpcRequestBase):

jsonrpc: Annotated[str, Field(description="JSON RPC Version", examples=["2.0"])]
params: Annotated[
Optional[Dict[str, Any]], # noqa: UP006, UP007 - prevent pytest failing in back-compat
dict[str, Any] | None,
Field(description="Dictionary of parameters passed to the method."),
]

Expand Down Expand Up @@ -103,7 +99,7 @@ class WorkerQueuesBase(BaseModel):
"""Queues that a worker supports to run jobs on."""

queues: Annotated[
Optional[List[str]], # noqa: UP006, UP007 - prevent pytest failing in back-compat
list[str] | None,
Field(
None,
description="List of queues the worker is pulling jobs from. If not provided, worker pulls from all queues.",
Expand All @@ -123,13 +119,13 @@ class WorkerStateBody(WorkerQueuesBase):
state: Annotated[EdgeWorkerState, Field(description="State of the worker from the view of the worker.")]
jobs_active: Annotated[int, Field(description="Number of active jobs the worker is running.")] = 0
queues: Annotated[
Optional[List[str]], # noqa: UP006, UP007 - prevent pytest failing in back-compat
list[str] | None,
Field(
description="List of queues the worker is pulling jobs from. If not provided, worker pulls from all queues."
),
] = None
sysinfo: Annotated[
Dict[str, Union[str, int]], # noqa: UP006, UP007 - prevent pytest failing in back-compat
dict[str, str | int],
Field(
description="System information of the worker.",
examples=[
Expand All @@ -148,11 +144,11 @@ class WorkerQueueUpdateBody(BaseModel):
"""Changed queues for the worker."""

new_queues: Annotated[
Optional[List[str]], # noqa: UP006, UP007 - prevent pytest failing in back-compat
list[str] | None,
Field(description="Additional queues to be added to worker."),
]
remove_queues: Annotated[
Optional[List[str]], # noqa: UP006, UP007 - prevent pytest failing in back-compat
list[str] | None,
Field(description="Queues to remove from worker."),
]

Expand Down

0 comments on commit e30aa57

Please sign in to comment.