-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SNOW-1826257]: Refactor docs to provide one place for supported aggr…
…egation functions (#2680) <!--- Please answer these questions before creating your pull request. Thanks! ---> 1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR. <!--- In this section, please add a Snowflake Jira issue number. Note that if a corresponding GitHub issue exists, you should still include the Snowflake Jira issue number. For example, for GitHub issue #1400, you should add "SNOW-1335071" here. ---> Fixes SNOW-1826257 2. Fill out the following pre-review checklist: - [ ] I am adding a new automated test(s) to verify correctness of my new code - [ ] If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing - [ ] I am adding new logging messages - [ ] I am adding a new telemetry message - [ ] I am adding new credentials - [ ] I am adding a new dependency - [ ] If this is a new feature/behavior, I'm adding the Local Testing parity changes. - [ ] I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: [Thread-safe Developer Guidelines](https://docs.google.com/document/d/162d_i4zZ2AfcGRXojj0jByt8EUq-DrSHPPnTa4QvwbA/edit#bookmark=id.e82u4nekq80k) 3. Please describe how your code solves the related issue. There are four functions that provide aggregation - DataFrame.agg, Series.agg, DataFrameGroupBy.agg, and SeriesGroupBy.agg. They share similar code paths, so whenever an aggregation function is added, it generally supports more than one of the APIs. We document each API in a different page though, so code authors need to update 3-4 different docs - which can lead to inconsistent docs (in the case that someone forgets to update one or all of the docs). This refactor moves all documentation of supported aggregation functions to one page, which should help keep the docs consistent and correct.
- Loading branch information
1 parent
2fcf2ff
commit 665bef1
Showing
5 changed files
with
119 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
:orphan: | ||
|
||
Supported Aggregation Functions | ||
==================================== | ||
|
||
This page lists which aggregation functions are supported by ``DataFrame.agg``, | ||
``Series.agg``, ``DataFrameGroupBy.agg``, and ``SeriesGroupBy.agg``. | ||
The following table is structured as follows: The first column contains the aggregation function's name. | ||
The second column is a flag for whether or not the aggregation is supported by ``DataFrame.agg``. The | ||
third column is a flag for whether or not the aggregation is supported by ``Series.agg``. The fourth column | ||
is whether or not the aggregation is supported by ``DataFrameGroupBy.agg``. The fifth column is whether or not | ||
the aggregation is supported by ``SeriesGroupBy.agg``. | ||
|
||
.. note:: | ||
``Y`` stands for yes (supports distributed implementation), ``N`` stands for no (API simply errors out), | ||
and ``P`` stands for partial (meaning some parameters may not be supported yet). | ||
|
||
Both Python builtin and NumPy functions are supported for ``DataFrameGroupBy.agg`` and ``SeriesGroupBy.agg``. | ||
|
||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| Aggregation Function | ``DataFrame.agg`` supports? (Y/N/P) | ``Series.agg`` supports? (Y/N/P) | ``DataFrameGroupBy.agg`` supports? (Y/N/P) | ``SeriesGroupBy.agg`` supports? (Y/N/P) | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``count`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | For ``axis=1``, ``Y`` if index is | | | | | ||
| | not a MultiIndex. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``mean`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | ``N`` for ``axis=1``. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``min`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | For ``axis=1``, ``Y`` if index is | | | | | ||
| | not a MultiIndex. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``max`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | For ``axis=1``, ``Y`` if index is | | | | | ||
| | not a MultiIndex. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``sum`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | For ``axis=1``, ``Y`` if index is | | | | | ||
| | not a MultiIndex. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``median`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | ``N`` for ``axis=1``. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``size`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | | ||
| | ``N`` for ``axis=1``. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``std`` | ``P`` for ``axis=0`` - only when | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | | ||
| | ``ddof=0`` or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | | ||
| | ``N`` for ``axis=1``. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``var`` | ``P`` for ``axis=0`` - only when | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | | ||
| | ``ddof=0`` or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | | ||
| | ``N`` for ``axis=1``. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``quantile`` | ``P`` for ``axis=0`` - only when | ``P`` - only when ``q`` is the | ``P`` - only when ``q`` is the | ``P`` - only when ``q`` is the | | ||
| | ``q`` is the default value or | default value or a scalar. | default value or a scalar. | default value or a scalar. | | ||
| | a scalar. | | | | | ||
| | ``N`` for ``axis=1``. | | | | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ | ||
| ``len`` | ``N`` | ``N`` | ``Y`` | ``Y`` | | ||
+-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters