From 405b2c84d67252f16556c90010b08b4efc3f48f3 Mon Sep 17 00:00:00 2001 From: shati-patel <42641846+shati-patel@users.noreply.github.com> Date: Wed, 9 Jun 2021 15:25:28 +0100 Subject: [PATCH 1/3] Clarify how to think about rank aggregate - Mention that `rank[1](...)` is the same as `min(...)` - Make this (+ note about 1-based indexing) more visible --- docs/codeql/ql-language-reference/expressions.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/codeql/ql-language-reference/expressions.rst b/docs/codeql/ql-language-reference/expressions.rst index f8869e427a0..5ca896e5b41 100644 --- a/docs/codeql/ql-language-reference/expressions.rst +++ b/docs/codeql/ql-language-reference/expressions.rst @@ -308,7 +308,10 @@ The following aggregates are available in QL: rank[4](int i | i = [5 .. 15] | i) - Note that the rank indices start at ``1``, so ``rank[0](...)`` returns no results. + .. pull-quote:: Note + + - Rank indices start at ``1``, so ``rank[0](...)`` returns no results. + - ``rank[1](...)`` is the same as ``min(...)``. .. index:: strictconcat, strictcount, strictsum From 0c9b53a9b27d25067cbd0b82ee8bb9659b80413c Mon Sep 17 00:00:00 2001 From: shati-patel <42641846+shati-patel@users.noreply.github.com> Date: Wed, 9 Jun 2021 15:27:01 +0100 Subject: [PATCH 2/3] Fix table formatting --- docs/codeql/ql-language-reference/expressions.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/codeql/ql-language-reference/expressions.rst b/docs/codeql/ql-language-reference/expressions.rst index 5ca896e5b41..00f3a5265de 100644 --- a/docs/codeql/ql-language-reference/expressions.rst +++ b/docs/codeql/ql-language-reference/expressions.rst @@ -533,14 +533,21 @@ The query produces these results: +-----------+---------+------+ | variant | person | cost | -+-----------+---------+------+ ++===========+=========+======+ | default | Alice | 201 | ++-----------+---------+------+ | default | Bob | 100 | ++-----------+---------+------+ | default | Charles | 100 | ++-----------+---------+------+ | default | Diane | 0 | ++-----------+---------+------+ | monotonic | Alice | 101 | ++-----------+---------+------+ | monotonic | Alice | 200 | ++-----------+---------+------+ | monotonic | Bob | 100 | ++-----------+---------+------+ | monotonic | Diane | 0 | +-----------+---------+------+ From b5420a6f3975566e4f4ccfdffc2ef92b3f3f387b Mon Sep 17 00:00:00 2001 From: shati-patel <42641846+shati-patel@users.noreply.github.com> Date: Wed, 9 Jun 2021 15:52:46 +0100 Subject: [PATCH 3/3] Update wording --- docs/codeql/ql-language-reference/expressions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/ql-language-reference/expressions.rst b/docs/codeql/ql-language-reference/expressions.rst index 00f3a5265de..08a925b50b8 100644 --- a/docs/codeql/ql-language-reference/expressions.rst +++ b/docs/codeql/ql-language-reference/expressions.rst @@ -310,7 +310,7 @@ The following aggregates are available in QL: .. pull-quote:: Note - - Rank indices start at ``1``, so ``rank[0](...)`` returns no results. + - Rank indices start at ``1``, so ``rank[0](...)`` has no result. - ``rank[1](...)`` is the same as ``min(...)``. .. index:: strictconcat, strictcount, strictsum