Skip to content

Commit

Permalink
Merge pull request #1599 from jertel/jertel/wip
Browse files Browse the repository at this point in the history
Upgrades and deprecation warnings
  • Loading branch information
jertel authored Jan 6, 2025
2 parents 696e505 + 4ceaf7f commit 63c7be5
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 28 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@
- [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
- Add support for Kibana 8.17 for Kibana Discover - [#1597](https://github.com/jertel/elastalert2/pull/1597) - @nsano-rururu
- Resolve runtime deprecation warnings related to Elastic's 8.16 range filter changes - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Resolve test deprecation warnings related to prettytable enum changes - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency pylint to 3.3.3 (build) - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency pytest to 8.3.4 (build) - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency pytest-cov to 6.0.0 (build) - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency sphinx to 8.1.3 (build) - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency sphinx_rtd_theme to 3.0.2 (build) - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency tox to 4.23.2 (build) - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency apscheduler to 3.11.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency boto3 to 1.35.92 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency cffi to 1.17.1 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency croniter to 6.0.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency jinja2 to 3.1.5 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency jira to 3.8.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency jsonpointer to 3.0.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency jsonschema to 4.23.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency prettytable to 3.12.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency prometheus-client to 0.21.1 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency pyyaml to 6.0.2 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency requests to 2.32.3 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency stomp.py to 8.2.0 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency tencentcloud-sdk-python to 3.0.1295 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel
- Upgrade dependency twilio to 9.4.1 - [#1599](https://github.com/jertel/elastalert2/pull/1599) - @jertel

# 2.22.0

Expand Down
10 changes: 5 additions & 5 deletions elastalert/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from jinja2 import Template

from prettytable import PrettyTable
from prettytable import MSWORD_FRIENDLY
from prettytable import ALL
from prettytable import TableStyle
from prettytable import HRuleStyle, VRuleStyle

from texttable import Texttable

Expand Down Expand Up @@ -308,11 +308,11 @@ def get_aggregation_summary_text(self, matches):
# an abandoned PR (https://github.com/jertel/elastalert2/pull/1227).
text_table = PrettyTable()
text_table.field_names = summary_table_fields_with_count
text_table.set_style(MSWORD_FRIENDLY)
text_table.set_style(TableStyle.MSWORD_FRIENDLY)
text_table.border = True
text_table.header = True
text_table.hrules = ALL
text_table.vrules = ALL
text_table.hrules = HRuleStyle.ALL
text_table.vrules = VRuleStyle.ALL
text_table.header = True
text_table.format = True
for keys, count in match_aggregation.items():
Expand Down
4 changes: 2 additions & 2 deletions elastalert/elastalert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,8 +1520,8 @@ def find_recent_pending_alerts(self, time_limit):

# Fetch recent, unsent alerts that aren't part of an aggregate, earlier alerts first.
inner_query = {'query_string': {'query': '!_exists_:aggregate_id AND alert_sent:false'}}
time_filter = {'range': {'alert_time': {'from': dt_to_ts(ts_now() - time_limit),
'to': dt_to_ts(ts_now())}}}
time_filter = {'range': {'alert_time': {'gte': dt_to_ts(ts_now() - time_limit),
'lte': dt_to_ts(ts_now())}}}
sort = {'sort': {'alert_time': {'order': 'asc'}}}
query = {'query': {'bool': {'must': inner_query, 'filter': time_filter}}}
query.update(sort)
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
flake8
flake8-absolute-import
pre-commit
pylint==3.3.1
pytest==8.3.3
pytest-cov==5.0.0
pylint==3.3.3
pytest==8.3.4
pytest-cov==6.0.0
pytest-xdist==3.6.1
setuptools
sphinx==8.0.2
sphinx_rtd_theme==3.0.1
tox==4.21.2
sphinx==8.1.3
sphinx_rtd_theme==3.0.2
tox==4.23.2
30 changes: 15 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
apscheduler>=3.10.4,<4.0
apscheduler>=3.11.0,<4.0
aws-requests-auth>=0.4.3
boto3>=1.34.54
cffi>=1.16.0
croniter>=2.0.2
boto3>=1.35.92
cffi>=1.17.1
croniter>=6.0.0
elasticsearch==7.10.1
envparse>=0.2.0
exotel==0.1.5
Jinja2>=3.1.3
jira>=3.5.2
jsonpointer>=2.4
jsonschema>=4.21.1
prettytable>=3.10.0
Jinja2>=3.1.5
jira>=3.8.0
jsonpointer>=3.0.0
jsonschema>=4.23.0
prettytable>=3.12.0
prison>=0.2.1
prometheus_client>=0.20.0
prometheus-client>=0.21.1
python-dateutil>=2.9.0.post0
PyYAML>=6.0.1
PyYAML>=6.0.2
py-zabbix>=1.1.7
requests>=2.31.0
requests>=2.32.3
sortedcontainers>=2.4.0
statsd-tags==3.2.1.post1
stomp.py>=8.1.0
tencentcloud-sdk-python>=3.0.1098
stomp.py>=8.2.0
tencentcloud-sdk-python>=3.0.1295
texttable>=1.7.0
twilio>=8.13.0
twilio>=9.4.1

0 comments on commit 63c7be5

Please sign in to comment.