Skip to content

Commit

Permalink
Hotfix: Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dule1322 committed Jun 14, 2024
1 parent 5eaf27f commit af77bcf
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions coretex/entities/task_run/parameter/base_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from typing import Dict, Optional, Any, Tuple, List, TypeVar, Generic
from typing import Dict, Optional, Any, Tuple, List, TypeVar, Generic, Union
from abc import ABC, abstractmethod

import logging
Expand All @@ -29,11 +29,23 @@

class BaseParameter(ABC, Generic[T]):

def __init__(self, name: str, description: str, value: Optional[T], dataType: str, required: bool, type: int = 3) -> None:
def __init__(
self,
name: str,
description: str,
value: Optional[T],
dataType: Union[str, ParameterType],
required: bool,
type: int = 3
) -> None:

if isinstance(dataType, str):
dataType = ParameterType(dataType)

self.name = name
self.description = description
self.value = value
self.dataType = ParameterType(dataType)
self.dataType = dataType
self.required = required
self.type_ = type

Expand Down

0 comments on commit af77bcf

Please sign in to comment.