Skip to content

Commit

Permalink
Fix returned type around datetime
Browse files Browse the repository at this point in the history
fix: 9851ca6

Signed-off-by: Thibaud CANALE <thican@thican.net>
  • Loading branch information
thican committed Dec 22, 2024
1 parent b1680e6 commit fdfd399
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elastalert/test_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _parse_args(self, args: list) -> argparse.Namespace:

return parsed_args

def str_to_ts(self, input: str) -> datetime:
def str_to_ts(self, input: str) -> datetime.datetime:
if input == "NOW":
return self.ts_now

Expand All @@ -148,7 +148,7 @@ def str_to_ts(self, input: str) -> datetime:
f"Input is not a valid ISO8601 timestamp (YYYY-MM-DDTHH:MM:SS+XX:00): {input}"
)

def parse_starttime(self, timeframe=None) -> datetime:
def parse_starttime(self, timeframe=None) -> datetime.datetime:
if self.args.start:
try:
return self.str_to_ts(self.args.start)
Expand Down

0 comments on commit fdfd399

Please sign in to comment.