Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #221 +/- ##
==========================================
- Coverage 96.01% 95.76% -0.26%
==========================================
Files 15 15
Lines 1607 1629 +22
==========================================
+ Hits 1543 1560 +17
- Misses 64 69 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
min/max syntatic sugar
2cba952 to
b351352
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
min/maxcalled with a single list/generator comprehension lowers toMin(...)/Max(...)so aggregate simplification can process them.min/maxwhen used with comprehensions.Description
_resolve_min_max_calltofunc_adl/ast/syntatic_sugar.pyto detectmin/maxcalls on comprehensions, validate signatures, and returnMin(...)/Max(...)AST calls.resolve_syntatic_sugarso it runs after the existingany/alllowering.README.mdanddocs/source/generic/query_structure.mdto describe themin/maxlowering and show an example aggregate-form rewrite usingMax(...).tests/ast/test_syntatic_sugar.pywith positive tests formin/maxlowering and additional negative tests asserting invalid signatures raiseValueError.Testing
pytest -q tests/ast/test_syntatic_sugar.pyand it succeeded (46 passed).pytest -qand it succeeded (438 passed).black --check func_adl testsand it succeeded, whileblack --checkthat includedREADME.mdand the modified markdown docs failed due to Black parsing those markdown files as Python (markdown files are not targeted byblack), so code and tests remain formatted.flake8 func_adl testsand it succeeded with no issues.Codex Task