feat(api): ajoute l'opérateur de filtre differs (IS DISTINCT FROM) (#78)

Implémente l'opérateur de filtre `differs` qui génère un fragment SQL
`IS DISTINCT FROM` pour exclure des valeurs en tenant compte des NULL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-06-22 13:55:18 +02:00
parent f5db674e22
commit 2a8e82ccd6
3 changed files with 26 additions and 0 deletions
+10
View File
@@ -102,3 +102,13 @@ def test_data_sort_desc(api_client, valid_token_header):
row["dateNotification"] for row in body["data"] if row.get("dateNotification")
]
assert dates == sorted(dates, reverse=True)
def test_data_differs_excludes_value(api_client, valid_token_header):
client, _ = api_client
base = client.get("/api/v1/data?page_size=1", headers=valid_token_header).get_json()
uid = base["data"][0]["uid"]
resp = client.get(f"/api/v1/data?uid__differs={uid}", headers=valid_token_header)
assert resp.status_code == 200
body = resp.get_json()
assert all(row["uid"] != uid for row in body["data"])