Skip to content

Commit

Permalink
HOTFIX: Python 3.9 does not support type list (#203)
Browse files Browse the repository at this point in the history
* Update version.txt

* Update README.md

* chore: Update `convert_to_expected_type` function signature

* chore: Mock config in unit tests for TestHelpersFunctions

* undo a change

* HOTFIX: Python <3.9 does not support type list
  • Loading branch information
0x7878 committed Jun 19, 2024
1 parent 6ab9f90 commit 97c55d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def get_value_by_path(meter_data: dict, path):
return value


def convert_to_expected_type(value: str, expected_type: list[str, int, float, bool],
default: list[None, str, int, float, bool]) -> list[None, str, int, float, bool]:
def convert_to_expected_type(value: str, expected_type: [str, int, float, bool], # type: ignore
default: [None, str, int, float, bool]) -> [None, str, int, float, bool]: # type: ignore
''' Try to convert value to expected_type, otherwise return default'''
try:
conversion_functions = {
Expand Down

0 comments on commit 97c55d9

Please sign in to comment.