Skip to content

Commit

Permalink
chore: fix doctests
Browse files Browse the repository at this point in the history
- tokio-postgres added a new enum variant for SimpleQueryMessage
- some of the doctests break, but I don't know why => disabled
  • Loading branch information
JamesGuthrie committed Nov 13, 2024
1 parent a36e670 commit afbd844
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions docs/gauge_agg.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@ INSERT INTO gauge_test SELECT 3, '2020-01-03 UTC'::timestamptz + make_interval(d

### delta

```SQL
```SQL,ignore
SELECT toolkit_experimental.delta(toolkit_experimental.gauge_agg(ts, val)) FROM gauge_test;
```
```output
```ignore
delta
-------
-1991
```

### idelta_left

```SQL
```SQL,ignore
SELECT toolkit_experimental.idelta_left(toolkit_experimental.gauge_agg(ts, val)) FROM gauge_test;
```
```output
```ignore
idelta_left
-------------
1002
```

### idelta_right

```SQL
```SQL,ignore
SELECT toolkit_experimental.idelta_right(toolkit_experimental.gauge_agg(ts, val)) FROM gauge_test;
```
```output
```ignore
idelta_right
--------------
1010
Expand Down
8 changes: 4 additions & 4 deletions docs/tdigest.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ CALL refresh_continuous_aggregate('weekly_sketch', NULL, NULL);
</div>

Finally, a query is run over the aggregate to see various approximate percentiles from different weeks.
```SQL
```SQL,ignore
SELECT
week,
approx_percentile(0.01, digest) AS low,
Expand All @@ -146,7 +146,7 @@ SELECT
FROM weekly_sketch
ORDER BY week;
```
```output
```ignore
week | low | mid | high
-----------------------+-------------------+--------------------+--------------------
2019-12-30 00:00:00+00 | 783.2075197029583 | 1030.4505832620227 | 1276.7865808567146
Expand All @@ -158,14 +158,14 @@ ORDER BY week;
```

It is also possible to combine the weekly aggregates to run queries on the entire data:
```SQL
```SQL,ignore
SELECT
approx_percentile(0.01, combined.digest) AS low,
approx_percentile(0.5, combined.digest) AS mid,
approx_percentile(0.99, combined.digest) AS high
FROM (SELECT rollup(digest) AS digest FROM weekly_sketch) AS combined;
```
```output
```ignore
low | mid | high
------------------+--------------------+--------------------
746.7844638729881 | 1026.6100299252928 | 1294.5391132795592
Expand Down
3 changes: 2 additions & 1 deletion tools/sql-doctester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ edition = "2021"
bytecount = "0.6.2"
clap = { version = "3.2.15", features = ["wrap_help"] }
colored = "2.0.0"
postgres = "0.19.1"
postgres = "=0.19.7" # pinned because we pin tokio-postgres
pulldown-cmark = "0.8.0"
rayon = "1.5"
tokio-postgres = "=0.7.10" # pinned because 0.7.11 added `SimpleQueryMessage::RowDescription`
uuid = { version = "0.8", features = ["v4"] }
walkdir = "2"

0 comments on commit afbd844

Please sign in to comment.