We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1954f92 commit d981cd8Copy full SHA for d981cd8
pyproject.toml
@@ -37,10 +37,11 @@ classifiers = [
37
requires-python = ">= 3.11, < 4"
38
dependencies = [
39
"typing-extensions >= 4.6.1, < 5",
40
- "frequenz-api-dispatch == 1.0.0-rc1",
+ # "frequenz-api-dispatch == 1.0.0-rc1",
41
+ "frequenz-api-dispatch @ git+https://github.com/frequenz-floss/frequenz-api-dispatch@4274d1a",
42
"frequenz-client-base >= 0.8.0, < 0.10.0",
43
"frequenz-client-common >= 0.1.0, < 0.4.0",
- "grpcio >= 1.66.1, < 2",
44
+ "grpcio >= 1.70.0, < 2",
45
"python-dateutil >= 2.8.2, < 3.0",
46
]
47
dynamic = ["version"]
@@ -93,7 +94,8 @@ dev-pylint = [
93
94
"pylint == 3.3.6",
95
# For checking the noxfile, docs/ script, and tests
96
"frequenz-client-dispatch[cli,dev-mkdocs,dev-noxfile,dev-pytest]",
97
98
99
100
dev-pytest = [
101
"pytest == 8.3.5",
src/frequenz/client/dispatch/_client.py
@@ -166,7 +166,7 @@ def to_interval(
166
) -> PBTimeIntervalFilter | None:
167
return (
168
PBTimeIntervalFilter(
169
- **{"from": to_timestamp(from_)}, to=to_timestamp(to)
+ from_time=to_timestamp(from_), to_time=to_timestamp(to)
170
)
171
if from_ or to
172
else None
src/frequenz/client/dispatch/recurrence.py
@@ -88,8 +88,8 @@ def from_protobuf(cls, pb_criteria: PBRecurrenceRule.EndCriteria) -> "EndCriteri
88
match pb_criteria.WhichOneof("count_or_until"):
89
case "count":
90
instance.count = pb_criteria.count
91
- case "until":
92
- instance.until = to_datetime(pb_criteria.until)
+ case "until_time":
+ instance.until = to_datetime(pb_criteria.until_time)
return instance
def to_protobuf(self) -> PBRecurrenceRule.EndCriteria:
@@ -103,7 +103,7 @@ def to_protobuf(self) -> PBRecurrenceRule.EndCriteria:
103
if self.count is not None:
104
pb_criteria.count = self.count
105
elif self.until is not None:
106
- pb_criteria.until.CopyFrom(to_timestamp(self.until))
+ pb_criteria.until_time.CopyFrom(to_timestamp(self.until))
107
108
return pb_criteria
109
src/frequenz/client/dispatch/test/_service.py
@@ -188,20 +188,20 @@ def _filter_dispatch(
188
if target != dispatch.target:
189
return False
190
if _filter.HasField("start_time_interval"):
191
- if start_from := _filter.start_time_interval.__dict__["from"]:
+ if start_from := _filter.start_time_interval.from_time:
192
if dispatch.start_time < _to_dt(start_from):
193
194
- if start_to := _filter.start_time_interval.to:
+ if start_to := _filter.start_time_interval.to_time:
195
if dispatch.start_time >= _to_dt(start_to):
196
197
if _filter.HasField("end_time_interval"):
198
- if end_from := _filter.end_time_interval.__dict__["from"]:
+ if end_from := _filter.end_time_interval.from_time:
199
if (
200
dispatch.duration
201
and dispatch.start_time + dispatch.duration < _to_dt(end_from)
202
):
203
204
- if end_to := _filter.end_time_interval.to:
+ if end_to := _filter.end_time_interval.to_time:
205
206
207
and dispatch.start_time + dispatch.duration >= _to_dt(end_to)
src/frequenz/client/dispatch/types.py
@@ -295,7 +295,7 @@ def from_protobuf(cls, pb_object: PBDispatch) -> "Dispatch":
295
id=pb_object.metadata.dispatch_id,
296
type=pb_object.data.type,
297
create_time=to_datetime(pb_object.metadata.create_time),
298
- update_time=to_datetime(pb_object.metadata.modification_time),
+ update_time=to_datetime(pb_object.metadata.update_time),
299
end_time=(
300
to_datetime(pb_object.metadata.end_time)
301
if pb_object.metadata.HasField("end_time")
@@ -327,7 +327,7 @@ def to_protobuf(self) -> PBDispatch:
327
metadata=DispatchMetadata(
328
dispatch_id=self.id,
329
create_time=to_timestamp(self.create_time),
330
- modification_time=to_timestamp(self.update_time),
+ update_time=to_timestamp(self.update_time),
331
332
to_timestamp(self.end_time) if self.end_time is not None else None
333
),
0 commit comments