Skip to content

Commit 38083c4

Browse files
Update reporting api dependency (#58)
Addressing issue #41
2 parents e5b2f02 + a129aaa commit 38083c4

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+
* Upgrading "frequenz-api-reporting >= 0.1.1, < 0.2" to "frequenz-api-reporting >= 0.2.0, < 0.3"
10+
* Upgrading "frequenz-client-common == 0.1.0" to "frequenz-client-common >= 0.2.0, < 0.3"
1011

1112
## New Features
1213

13-
<!-- Here goes the main new features and examples or instructions on how to use them -->
14+
* The `ReportingApiClient` exposes the resampling option of the data, with its
15+
resolution represented in second and its default set to `None`.
1416

1517
## Bug Fixes
1618

docs/_scripts/macros.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _slugify(text: str) -> str:
3030
# The type of the return value is not defined for the markdown library.
3131
# Also for some reason `mypy` thinks the `toc` module doesn't have a
3232
# `slugify_unicode` function, but it definitely does.
33-
return toc.slugify_unicode(text, "-") # type: ignore[attr-defined,no-any-return]
33+
return toc.slugify_unicode(text, "-")
3434

3535

3636
def _hook_macros_plugin(env: macros.MacrosPlugin) -> None:

pyproject.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ classifiers = [
2626
]
2727
requires-python = ">= 3.11, < 4"
2828
dependencies = [
29-
"typing-extensions >= 4.5.0, < 5",
30-
"frequenz-api-reporting >= 0.1.1, < 0.2",
31-
"frequenz-client-common == 0.1.0",
29+
"typing_extensions >= 4.6.1, < 5",
30+
"grpc-stubs == 1.24.12",
31+
"frequenz-api-reporting >= 0.2.0, < 0.3",
32+
"frequenz-client-common >= 0.2.0, < 0.3",
33+
"grpcio >= 1.54.2, < 2",
34+
"grpcio-tools >= 1.54.2, < 2",
35+
"protobuf >= 4.25.3, < 5",
3236
]
3337
dynamic = ["version"]
3438

@@ -57,8 +61,9 @@ dev-mkdocs = [
5761
"frequenz-repo-config[lib] == 0.9.1",
5862
]
5963
dev-mypy = [
60-
"mypy == 1.5.1",
61-
"types-Markdown == 3.4.2.10",
64+
"mypy == 1.10.0",
65+
"types-Markdown == 3.6.0.20240316",
66+
"types-protobuf == 4.24.0.20240129",
6267
# For checking the noxfile, docs/ script, and tests
6368
"frequenz-client-reporting[dev-mkdocs,dev-noxfile,dev-pytest]",
6469
"pandas-stubs >= 2, < 3", # Only required for example
@@ -84,7 +89,6 @@ dev = [
8489
"frequenz-client-reporting[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
8590
]
8691
examples = [
87-
"grpcio >= 1.51.1, < 2",
8892
"pandas >= 2, < 3",
8993
]
9094

@@ -159,12 +163,12 @@ namespace_packages = true
159163
# (or vice versa). In particular errors saying that type: ignore is not
160164
# used but getting the original ignored error when removing the type: ignore.
161165
# See for example: https://github.com/python/mypy/issues/2960
162-
#no_incremental = true
166+
no_incremental = true
163167
packages = ["frequenz.client.reporting"]
164168
strict = true
165169

166170
[[tool.mypy.overrides]]
167-
module = ["mkdocs_macros.*", "sybil", "sybil.*"]
171+
module = ["grpc.aio", "grpc.aio.*", "mkdocs_macros.*", "sybil", "sybil.*"]
168172
ignore_missing_imports = true
169173

170174
[tool.setuptools_scm]

src/frequenz/client/reporting/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def __iter__(self) -> Iterator[MetricSample]:
9090
ts = msample.sampled_at.ToDatetime()
9191
met = Metric.from_proto(msample.metric).name
9292
value = (
93-
msample.sample.simple_metric.value
94-
if msample.sample.simple_metric
93+
msample.value.simple_metric.value
94+
if msample.value.simple_metric
9595
else None
9696
)
9797
yield MetricSample(

0 commit comments

Comments
 (0)