Skip to content

Fix CloudWatch Logs Insights asc/desc sort direction#9845

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

Fix CloudWatch Logs Insights asc/desc sort direction#9845
SergioChan wants to merge 1 commit intogetmoto:masterfrom
SergioChan:fix-logs-query-sort-order-9818

Conversation

@SergioChan
Copy link
Contributor

Summary

  • fix ParsedQuery.sort_reversed() so sort ... desc maps to sorted(..., reverse=True) and sort ... asc maps to ascending output
  • keep query execution behavior unchanged otherwise and only adjust sort-direction handling
  • update logs query tests to assert the corrected ordering for both default (desc) and explicit asc

Testing

  • python -m pytest tests/test_logs/test_logs_query/test_query.py

Related

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (4e435f4) to head (c2fa0a4).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9845      +/-   ##
==========================================
- Coverage   93.12%   93.12%   -0.01%     
==========================================
  Files        1308     1308              
  Lines      118885   118885              
==========================================
- Hits       110707   110706       -1     
- Misses       8178     8179       +1     
Flag Coverage Δ
servertests 28.89% <100.00%> (ø)
unittests 93.09% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

1 participant