File tree Expand file tree Collapse file tree 5 files changed +427
-357
lines changed Expand file tree Collapse file tree 5 files changed +427
-357
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2929 poetry run pytest . -v
3030 - name : Coverage with pytest
3131 run : |
32- poetry run pytest . --cov --cov-report xml
32+ poetry run pytest . --cov --cov-report xml --cov-config=pyproject.toml
3333 - uses : codecov/codecov-action@v1
3434 with :
3535 token : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -276,3 +276,22 @@ def test_having():
276276
277277 assert clone == my_query
278278 assert str (clone ) == sql
279+
280+
281+ def test_group_by_json ():
282+ my_query = Query (
283+ entity = 'signatories' ,
284+ properties = [
285+ Property (name = 'signatories.additional_data->organisation->>name' ),
286+ Count (property = Property (name = 'signatories.additional_data->organisation->>name' ))
287+ ],
288+ group = [
289+ Property (name = 'signatories.additional_data->organisation->>name' )
290+ ]
291+ )
292+
293+ sql = "SELECT signatories.additional_data -> 'organisation' ->> 'name', COUNT(signatories.additional_data -> " \
294+ "'organisation' ->> 'name') FROM signatories GROUP BY signatories.additional_data -> 'organisation' ->> " \
295+ "'name';"
296+
297+ assert str (my_query == sql )
You can’t perform that action at this time.
0 commit comments