Skip to content

Commit

Permalink
fix: allow for bare dicts to get_lowest_object_rate function
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Dec 20, 2023
1 parent 3e326d2 commit a765612
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions easypost/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Dict,
List,
Optional,
Union,
)

from easypost.constant import (
Expand All @@ -24,10 +25,11 @@
InvalidParameterError,
SignatureVerificationError,
)
from easypost.models.rate import Rate


def get_lowest_object_rate(
easypost_object: EasyPostObject,
easypost_object: Union[EasyPostObject, Dict[str, Any]],
carriers: Optional[List[str]] = None,
services: Optional[List[str]] = None,
rates_key: str = "rates",
Expand All @@ -53,7 +55,7 @@ def get_lowest_object_rate(
return lowest_rate


def get_lowest_smart_rate(smart_rates, delivery_days: int, delivery_accuracy: str):
def get_lowest_smart_rate(smart_rates: List[Rate], delivery_days: int, delivery_accuracy: str):
"""Get the lowest SmartRate from a list of SmartRates."""
valid_delivery_accuracy_values = {
"percentile_50",
Expand Down

0 comments on commit a765612

Please sign in to comment.