Skip to content

fix(logs): correct CloudWatch query sort direction#9829

Closed
SergioChan wants to merge 1 commit intogetmoto:masterfrom
SergioChan:fix-9818-query-sort-order
Closed

fix(logs): correct CloudWatch query sort direction#9829
SergioChan wants to merge 1 commit intogetmoto:masterfrom
SergioChan:fix-9818-query-sort-order

Conversation

@SergioChan
Copy link
Contributor

Summary

  • Fix CloudWatch Logs query sort direction mapping so sort ... desc uses descending order and sort ... asc uses ascending order.
  • Update existing logs query tests to match the documented/default behavior (desc by default, asc when requested).

Testing

  • python -m py_compile moto/logs/logs_query/query_parser.py moto/logs/logs_query/__init__.py tests/test_logs/test_logs_query/test_query.py
  • Note: full pytest execution was not run in this environment because test dependencies are unavailable.

Related

Fixes #9818

@bblommers
Copy link
Collaborator

There's already an open PR to fix this: #9819

@bblommers bblommers closed this Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloudwatch log query sorting is the wrong way around

2 participants