Commit 713e00e
committed
Fix missing conversion to
The underlying channel is transporting `Quantity` objects, but the
`ResampledFormulaBuilder` is returning `QuantityT`, i.e. a specific
sub-type of `Quantity` (which has more methods than `Quantity`).
If this object is used to access the extra methods, then it will fail.
This bug was never triggered because the actual value is just always
used as an abstract `Quantity` (only `.base_value` is used), so the
conversion is not needed strictly speaking, but we need to use the type
system properly, and fix the issue at another level.
This will be properly fixed when we make `Quantity` abstract, and we
allow using a raw `float` for stuff that can be parametrized with
quantities. In this case the resampler will just send raw `float`s, so
we will not need to use `Quantity` at all when we are just operating
with raw data, and only apply the finally concrete `Quantity` type when
the data reaches the end user.
Signed-off-by: Leandro Lucarella <[email protected]>QuantityT
1 parent 2f44dbc commit 713e00e
File tree
1 file changed
+12
-3
lines changed- src/frequenz/sdk/timeseries/formula_engine
1 file changed
+12
-3
lines changedLines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
| |||
0 commit comments