lex-metering 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a10fe9b6e2c40b71f7556167188a71be8d73484d765f23279d2994936cf74a2f
|
|
4
|
+
data.tar.gz: ad31523cc20bc16562d434ba5b58dce57bad8e881ae28312fe8dcb0018f25823
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 777d385018eed31833102a0f5a4099159f95797590b5776bd4111d2684903ccd848217d025ebb9f15ea0b4af9291e9ad6022e2784dd1646a3fb8c1a5f3708a9e
|
|
7
|
+
data.tar.gz: 9479d089f44883e9e11ce9683d3d5c47090b493720ea1aba918ca8323d79056629a7cfde4c9945e8edbca0a9f4d9a673821b8163fd4e3c026a3f74aeb21bc977
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.17] - 2026-05-29
|
|
4
|
+
### Fixed
|
|
5
|
+
- `rollup_hour`: group raw records in Ruby via `records_ds.all.group_by { ... }` instead of `records_ds.group_by { ... }`. `Sequel::Dataset#group_by` is an alias for `#group`, so calling it on the dataset built an invalid SQL `GROUP BY []("worker_id"), ...` clause that PostgreSQL rejected (`PG::SyntaxError: syntax error at or near "["`), failing the hourly rollup actor on every tick.
|
|
6
|
+
- Rollup spec: assert the generated SQL never contains a malformed array `GROUP BY` by exercising a real Sequel mock-postgres connection (previously a dataset double stubbed `group_by` to behave like `Enumerable#group_by`, masking the defect).
|
|
7
|
+
|
|
3
8
|
## [0.1.16] - 2026-05-17
|
|
4
9
|
### Fixed
|
|
5
10
|
- Migration 001: remove indexes from `create_table?` block (Sequel creates indexes even when table exists, causing DuplicateTable error)
|
|
@@ -17,7 +17,11 @@ module Legion
|
|
|
17
17
|
.where(::Sequel.lit('recorded_at >= ? AND recorded_at < ?', hour, hour_end))
|
|
18
18
|
|
|
19
19
|
raw_count = records_ds.count
|
|
20
|
-
|
|
20
|
+
# Group in Ruby, not in SQL: Sequel::Dataset#group_by is an alias for #group
|
|
21
|
+
# (it builds a SQL GROUP BY clause), so calling it on the dataset emits invalid
|
|
22
|
+
# SQL (GROUP BY []("worker_id"), ...) instead of the intended in-memory grouping.
|
|
23
|
+
# Materialise the rows first, then use Enumerable#group_by on the array.
|
|
24
|
+
groups = records_ds.all.group_by { |r| [r[:worker_id], r[:provider], r[:model_id]] }
|
|
21
25
|
|
|
22
26
|
rollup_dataset = Legion::Data.connection[:metering_hourly_rollup]
|
|
23
27
|
rolled_up = 0
|