Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix returned type around datetime #1594

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
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
Loading