Siddharth-Dangi opened a new pull request, #77605:
URL: https://github.com/apache/airflow/pull/77605

   closes: #77591
   
   ### Summary
   
   `RangeFilter.to_orm()` and `NullableDatetimeRangeFilter.to_orm()` in 
`airflow-core/src/airflow/api_fastapi/common/parameters/range.py` checked bound 
values using truthiness (`if self.value.lower_bound_gte:`) instead of `is not 
None`. Numeric `0` and `0.0` bounds evaluate to falsy in Python, so range 
queries such as `max_active_runs_lte=0` silently skipped the SQL `WHERE` filter 
even though `RangeFilter.is_active()` already checks `is not None`.
   
   ### Changes
   - `airflow-core/src/airflow/api_fastapi/common/parameters/range.py`: Replace 
all 8 truthiness checks in `RangeFilter.to_orm()` and 
`NullableDatetimeRangeFilter.to_orm()` with explicit `is not None` checks.
   - `airflow-core/tests/unit/api_fastapi/common/test_parameters.py`: Add 
`TestRangeFilter` verifying compiled SQL clauses and SQLite query filtering for 
zero integer/float bounds (`0` and `0.0`).
   - 
`airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_backfills.py`: Add 
API regression check verifying `GET /backfills?max_active_runs_lte=0` filters 
out `max_active_runs=1` backfills.
   
   ### Local Verification
   - `uv run --project airflow-core pytest 
airflow-core/tests/unit/api_fastapi/common/test_parameters.py 
airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_backfills.py -v 
--tb=short` (`99 passed, 1 warning`)
   - `ruff format --check` (`3 files already formatted`) & `ruff check` (`All 
checks passed!`)
   - `python3 scripts/ci/prek/check_no_conventional_commit_message.py` (passed)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Antigravity AI coding assistant (Gemini) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Reviewed and verified every line of the diff, failure reproduction before 
the fix, and local unit tests/linters.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] Fix RangeFilter dropping ... Siddharth-Dangi (via GitHub) via commits

Reply via email to