(query, *expr)
| 521 | from sqlalchemy.dialects.postgresql import distinct_on |
| 522 | |
| 523 | def go(query, *expr): |
| 524 | if request.param == "legacy": |
| 525 | if expr: |
| 526 | with expect_deprecated( |
| 527 | "Passing expression to ``distinct`` to generate a " |
| 528 | "DISTINCT " |
| 529 | "ON clause is deprecated. Use instead the " |
| 530 | "``postgresql.distinct_on`` function as an extension." |
| 531 | ): |
| 532 | return query.distinct(*expr) |
| 533 | else: |
| 534 | return query.distinct() |
| 535 | elif request.param == "new": |
| 536 | return query.ext(distinct_on(*expr)) |
| 537 | |
| 538 | return go |
nothing calls this directly
no test coverage detected