Skip to content

Commit 7a3d211

Browse files
committed
Fixes typing issues for Python 3.7
1 parent a9bbb09 commit 7a3d211

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

mygeotab/parameters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
import re
1111
from copy import copy
12-
from typing import Any, Optional
12+
from typing import Any, Optional, Dict, Union
1313

1414

15-
def camelcaseify_parameters(parameters: dict[str, Any]) -> dict[str, Any]:
15+
def camelcaseify_parameters(parameters: Dict[str, Any]) -> Dict[str, Any]:
1616
"""Allows the use of Pythonic-style parameters with underscores instead of camel-case.
1717
1818
:param parameters: The parameters object.
@@ -34,7 +34,7 @@ def camelcaseify_parameters(parameters: dict[str, Any]) -> dict[str, Any]:
3434
return params
3535

3636

37-
def convert_get_parameters(parameters: dict[str, Any]) -> dict[str, Any]:
37+
def convert_get_parameters(parameters: Dict[str, Any]) -> Dict[str, Any]:
3838
"""Converts parameters passed into a get() call to a format suitable for the MyGeotab API.
3939
It detects if a 'search' dictionary is passed and flattens it into the top-level parameters.
4040
It also detects 'resultsLimit'/'results_limit' or 'sort' parameters and removes them from the parameters
@@ -68,7 +68,7 @@ def convert_get_parameters(parameters: dict[str, Any]) -> dict[str, Any]:
6868
return result
6969

7070

71-
def _try_extract_get_parameter(parameters: dict[str, Any], name: str, pythonic_name: Optional[str] = None) -> Any | None:
71+
def _try_extract_get_parameter(parameters: Dict[str, Any], name: str, pythonic_name: Optional[str] = None) -> Union[Any, None]:
7272
"""Helper to get a parameter from a dictionary, returning None if it doesn't exist."""
7373
parameter = parameters.get(name)
7474
if parameter is not None:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[tool.ruff]
22
line-length = 127
3+
target-version = "py37"
34

45
[tool.ruff.lint]
56
select = ["E", "F", "B"]

0 commit comments

Comments
 (0)