Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Improve the naming convention of reducers regarding the treatment of null values #1005

Open
randomboolean opened this issue Aug 11, 2021 · 0 comments

Comments

@randomboolean
Copy link
Contributor

randomboolean commented Aug 11, 2021

The suffixes of reducer names inform how they treat null values.

This naming convention is functional but it has some inconsistencies that can be confusing. It should be possible to improve it.

The suffixes are:

  • exclude-nulls : null values are removed
  • include-nulls : null values are not removed
  • forbids-nulls : an error is raised if a null value is encountered
  • nonnull : return null if at least one null value is encountered
  • ignore-nulls : similar to exclude-null but for APPLY

Inconsistency 1: Missing variants
Some base reducers have some variants with these suffixes, some don't.
(for example reducer.product does not have the same variant than reducer.sum)
This could be fixed by implementing the missing ones.

Inconsistency 2: Overlapping functionality
Does ignore-nulls means the same than exclude-nulls ?

Inconsistency 3: Default behavior
Base reducers don't have the same default behavior to null values.
For example reducer.mean behaves like if it were suffixed nonnull,
whereas reducer.median behaves like if it were suffixed exclude-nulls.

@randomboolean randomboolean changed the title The naming convention of reducers regarding treatment of null values can be improved [Discussion] Improve the naming convention of reducers regarding the treatment of null values Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant