Skip to content

Commit

Permalink
Remove annotated type and just use a union
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Oct 11, 2023
1 parent 01342d1 commit f95e337
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/jobflow_remote/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import traceback
from enum import Enum
from pathlib import Path
from typing import Annotated, Literal, Union
from typing import Literal

from jobflow import JobStore
from pydantic import BaseModel, Extra, Field, validator
Expand Down Expand Up @@ -318,9 +318,6 @@ def cli_info(self) -> dict:
)


WorkerConfig = Annotated[Union[LocalWorker, RemoteWorker], Field(discriminator="type")]


class ExecutionConfig(BaseModel):
"""
Configuration to be set before and after the execution of a Job.
Expand Down Expand Up @@ -369,7 +366,7 @@ class Project(BaseModel):
runner: RunnerOptions = Field(
default_factory=RunnerOptions, description="The options for the Runner"
)
workers: dict[str, WorkerConfig] = Field(
workers: dict[str, LocalWorker | RemoteWorker] = Field(
default_factory=dict,
description="A dictionary with the worker name as keys and the worker "
"configuration as values",
Expand Down

0 comments on commit f95e337

Please sign in to comment.