Skip to content

Commit 3b39585

Browse files
committed
Update _models.py
1 parent 9657883 commit 3b39585

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

featuremanagement/_time_window_filter/_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ def __init__(self, range_data: Dict[str, Any]):
106106
self.end_date = parsedate_to_datetime(end_date_str) if end_date_str else None
107107
except ValueError as e:
108108
raise ValueError(f"Invalid value for EndDate: {end_date_str}") from e
109+
except TypeError as e:
110+
# Python 3.9 and earlier throw TypeError if the string is not in RFC 2822 format.
111+
raise ValueError(f"Invalid value for EndDate: {end_date_str}") from e
109112
self.num_of_occurrences = range_data.get("NumberOfOccurrences", math.pow(2, 63) - 1)
110113
if self.num_of_occurrences < 0:
111114
raise ValueError("The number of occurrences must be greater than or equal to 0.")

0 commit comments

Comments
 (0)