From 1e0a770efdaa8cf8a6d184a8cb210f1de724b551 Mon Sep 17 00:00:00 2001 From: Thibaud CANALE Date: Fri, 1 Oct 2021 16:44:32 +0200 Subject: [PATCH] Fix returned type around datetime fix: 9851ca6b5cfaa869a5068c6da7ac0199fcb26be0 Signed-off-by: Thibaud CANALE --- CHANGELOG.md | 1 + elastalert/test_rule.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e00a4b8..5893fafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ## Other changes - [Docs] Add missing documentation of the `aggregation_alert_time_compared_with_timestamp_field` option. - [#1588](https://github.com/jertel/elastalert2/pull/1588) - @nicolasnovelli +- Fix linter error reporting about return type assignation in `elastalert/test_rule.py`. - [#1594](https://github.com/jertel/elastalert2/pull/1594) - @thican # 2.22.0 diff --git a/elastalert/test_rule.py b/elastalert/test_rule.py index 9bb16560..951afe14 100644 --- a/elastalert/test_rule.py +++ b/elastalert/test_rule.py @@ -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 @@ -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)