Skip to content

Commit a765612

Browse files
committed
fix: allow for bare dicts to get_lowest_object_rate function
1 parent 3e326d2 commit a765612

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

easypost/util.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Dict,
88
List,
99
Optional,
10+
Union,
1011
)
1112

1213
from easypost.constant import (
@@ -24,10 +25,11 @@
2425
InvalidParameterError,
2526
SignatureVerificationError,
2627
)
28+
from easypost.models.rate import Rate
2729

2830

2931
def get_lowest_object_rate(
30-
easypost_object: EasyPostObject,
32+
easypost_object: Union[EasyPostObject, Dict[str, Any]],
3133
carriers: Optional[List[str]] = None,
3234
services: Optional[List[str]] = None,
3335
rates_key: str = "rates",
@@ -53,7 +55,7 @@ def get_lowest_object_rate(
5355
return lowest_rate
5456

5557

56-
def get_lowest_smart_rate(smart_rates, delivery_days: int, delivery_accuracy: str):
58+
def get_lowest_smart_rate(smart_rates: List[Rate], delivery_days: int, delivery_accuracy: str):
5759
"""Get the lowest SmartRate from a list of SmartRates."""
5860
valid_delivery_accuracy_values = {
5961
"percentile_50",

0 commit comments

Comments
 (0)