Flux v0.132 (#3182)

* added flux 0.132.0 release notes

* updated influxdb sample package (#3173)
pull/3183/head
Scott Anderson 2021-09-28 15:41:51 -06:00 committed by GitHub
parent 3b9ec4490f
commit 8691340ff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 119 additions and 7 deletions

View File

@ -10,6 +10,29 @@ aliases:
- /influxdb/cloud/reference/release-notes/flux/
---
## v0.132.0 [2021-09-28]
### Features
- Copy location-related code from the Go `time` package.
- Create a `Vector` monotype.
- Refactor and optimize [`derivative()` transformation](/flux/v0.x/stdlib/universe/derivative/).
- Add new [InfluxDB sample datasets](/flux/v0.x/stdlib/influxdata/influxdb/sample/data/#available-influxdb-sample-datasets)
and [`sample.alignToNow()`](/flux/v0.x/stdlib/influxdata/influxdb/sample/aligntonow/).
- Allow query concurrency to be set to the number of nodes in the graph.
### Bug fixes
- Update null check with clear error message.
- Report errors from function parameters.
- Propagate all inferred properties to a function argument.
- Fix `Staticcheck` linter in `executetest`.
- Reformat non-formatted Flux files.
- Make builds reproducible by ordering package members in the `doc` package.
- Prevent the optimized `derivative()` from attempt to replicate a non-existent bug.
- Update [`events.duration()`](/flux/v0.x/stdlib/contrib/tomhollingworth/events/duration/)
to properly handle multiple buffers.
---
## v0.131.0 [2021-09-20]
### Features

View File

@ -0,0 +1,58 @@
---
title: sample.alignToNow() function
description: >
`sample.alignToNow()` shifts time values in input data to align the chronological last point to _now_.
menu:
flux_0_x_ref:
name: sample.alignToNow
parent: sample-pkg
weight: 301
related:
- /influxdb/v2.0/reference/sample-data/
introduced: 0.132.0
---
`sample.alignToNow()` shifts time values in input data to align the chronological last point to _now_.
Input data must have a `_time` column.
{{% note %}}
When writing static historical sample datasets to **InfluxDB Cloud**,
use `sample.alignToNow()` to avoid losing sample data with timestamps outside
of the retention period associated with your InfluxDB Cloud account.
{{% /note %}}
## Examples
#### Align sample data timestamps to the current time
```js
import "influxdata/influxdb/sample"
option now = () => 2021-01-01T00:00:00Z
data = sample.data(set: "birdMigration")
|> filter(fn: (r) =>
r._field == "lon" and
r.s2_cell_id == "471ed2c" and
r.id == "91916A"
)
|> tail(n: 3)
data
|> sample.alignToNow()
```
{{% expand "View input and output" %}}
#### Input data
| _time | _measurement | id | s2_cell_id | _field | _value |
| :------------------- | :----------- | :----- | :--------- | :----- | -------: |
| 2019-09-19T15:00:00Z | migration | 91916A | 471ed2c | lon | 21.10333 |
| 2019-09-22T09:00:00Z | migration | 91916A | 471ed2c | lon | 21.084 |
| 2019-09-22T15:00:00Z | migration | 91916A | 471ed2c | lon | 21.10317 |
#### Output data
| _time | _measurement | id | s2_cell_id | _field | _value |
| :------------------- | :----------- | :----- | :--------- | :----- | -------: |
| 2020-12-29T00:00:00Z | migration | 91916A | 471ed2c | lon | 21.10333 |
| 2020-12-31T18:00:00Z | migration | 91916A | 471ed2c | lon | 21.084 |
| 2021-01-01T00:00:00Z | migration | 91916A | 471ed2c | lon | 21.10317 |
{{% /expand %}}

View File

@ -42,10 +42,13 @@ and in the output of [`sample.list()`](/flux/v0.x/stdlib/influxdata/influxdb/sam
**Valid values**:
- `airSensor`
- `birdMigration`
- `noaa`
- `usgs`
- [`airSensor`](#airsensor)
- [`birdMigration`](#birdmigration)
- [`bitcoin`](#bitcoin)
- [`machineProduction`](#machineproduction)
- [`noaa`](#noaa)
- [`noaaWater`](#noaawater)
- [`usgs`](#usgs)
## Available InfluxDB sample datasets
@ -68,6 +71,24 @@ Contains geotemporal data between 2019-01-01 and 2019-12-31.
**Size**: ~1.2 MB • **Updated**: N/A
{{% /caption %}}
### bitcoin
Bitcoin price data from the last 30 days ([Powered by CoinDesk](https://www.coindesk.com/price/bitcoin)).
Data is updated approximately every 15m.
{{% caption %}}
**Size**: ~700 KB • **Updated**: every 15m
{{% /caption %}}
### machineProduction
States and metrics reported from four automated grinding wheel stations on a production line.
Contains data from 2021-08-01T00:00:00Z to 2021-08-01T23:59:59Z.
{{% caption %}}
**Size**: ~11.9 MB • **Updated**: N/A
{{% /caption %}}
### noaa
Latest observations from the [NOAA National Data Buoy Center (NDBC)](https://www.ndbc.noaa.gov/).
@ -78,6 +99,16 @@ Data is updated approximately every 15m.
**Size**: ~1.3 MB • **Updated**: every 15m
{{% /caption %}}
### noaaWater
Water level observations from two stations reported by the NOAA Center for
Operational Oceanographic Products and Services.
Contains data between 2019-08-17 and 2019-09-17.
{{% caption %}}
**Size**: ~10.3 MB • **Updated**: N/A
{{% /caption %}}
### usgs
USGS earthquake data from the last week.
@ -90,15 +121,15 @@ Data is updated approximately every 15m.
## Examples
##### Return USGS earthquake data from the last week
#### Return USGS earthquake data from the last week
```js
import "influxdata/influxdb/sample"
sample.data(set: "usgs")
```
##### Download and write NOAA NDBC data to InfluxDB
Add the following as an [InfluxDB task]{{< latest "influxdb" >}}/process-data/)
#### Download and write NOAA NDBC data to InfluxDB
Add the following as an [InfluxDB task](/{{< latest "influxdb" >}}/process-data/)
to regularly collect the latest reported observations from the NOAA NDBC.
{{% get-shared-text "flux/noaa-ndbc-sample-task.md" %}}