influxdata / influxdata/docs-v2

Update 'difference()' description to reflect actual behavior

Open
#1,998 0 comments 0 reactions 1 assignee View on GitHub

@kelseiv is already working on this.

Since Jul 30, 2021.

Flux
Dominant language
JavaScript
Stars
82
Forks
326
Avg merge
1d 1h
Merged PRs (30d)
82

Description

From Slack:

---

The docs on the `difference` function say:

> nonNegative indicates if the difference is allowed to be negative. When set to true, if a value is less than the previous value, it is assumed the previous value should have been a zero.

That sounds like if there's a negative difference, we'll get the original value instead (r["_value"] - 0), but we actually get null (and the examples later in the docs support this behavior).

Just to confirm: the null behavior is intended and the docs are wrong here, right?

---

##### Relevant URLs
- https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/difference/
- https://docs.influxdata.com/influxdb/cloud/reference/flux/stdlib/built-in/transformations/difference/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.