Skip to content

Commit 15dd5a2

Browse files
Merge branch 'main' into fix/fastapi-pydantic-model
2 parents 8f21ec4 + 809f80a commit 15dd5a2

File tree

9 files changed

+13
-10
lines changed

9 files changed

+13
-10
lines changed

.github/workflows/fossa.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ jobs:
4343
uses: actions/checkout@v4
4444

4545
- name: "Run FOSSA Scan"
46-
uses: fossas/fossa-action@v1.4.0 # Use a specific version if locking is preferred
46+
uses: fossas/fossa-action@v1.7.0 # Use a specific version if locking is preferred
4747
with:
4848
api-key: ${{ env.FOSSA_API_KEY }}
4949

5050
- name: "Run FOSSA Test"
51-
uses: fossas/fossa-action@v1.4.0 # Use a specific version if locking is preferred
51+
uses: fossas/fossa-action@v1.7.0 # Use a specific version if locking is preferred
5252
with:
5353
api-key: ${{ env.FOSSA_API_KEY }}
5454
run-tests: true

dapr/actor/runtime/_reminder_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(
3636
reminder_name: str,
3737
state: Optional[bytes],
3838
due_time: timedelta,
39-
period: timedelta,
39+
period: Optional[timedelta] = None,
4040
ttl: Optional[timedelta] = None,
4141
):
4242
"""Creates new :class:`ActorReminderData` instance.
@@ -77,7 +77,7 @@ def due_time(self) -> timedelta:
7777
return self._due_time
7878

7979
@property
80-
def period(self) -> timedelta:
80+
def period(self) -> Optional[timedelta]:
8181
"""Gets period of Actor Reminder."""
8282
return self._period
8383

dapr/actor/runtime/actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ async def register_reminder(
112112
name: str,
113113
state: bytes,
114114
due_time: timedelta,
115-
period: timedelta,
115+
period: Optional[timedelta] = None,
116116
ttl: Optional[timedelta] = None,
117117
) -> None:
118118
"""Registers actor reminder.

dapr/actor/runtime/mock_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async def register_reminder(
8686
name: str,
8787
state: bytes,
8888
due_time: timedelta,
89-
period: timedelta,
89+
period: Optional[timedelta] = None,
9090
ttl: Optional[timedelta] = None,
9191
) -> None:
9292
"""Adds actor reminder to self._state_manager._mock_reminders.

dapr/actor/runtime/state_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def ttl_in_seconds(self) -> Optional[int]:
5656
return self._ttl_in_seconds
5757

5858
@ttl_in_seconds.setter
59-
def ttl_in_seconds(self, new_ttl_in_seconds: int) -> None:
59+
def ttl_in_seconds(self, new_ttl_in_seconds: Optional[int]) -> None:
6060
self._ttl_in_seconds = new_ttl_in_seconds
6161

6262

dapr/clients/grpc/_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(
109109
super(InvokeMethodRequest, self).__init__(())
110110

111111
self._content_type = content_type
112-
self._http_verb = None
112+
self._http_verb: Optional[str] = None
113113
self._http_querystring: Dict[str, str] = {}
114114

115115
self.set_data(data)
@@ -127,7 +127,7 @@ def http_verb(self) -> Optional[str]:
127127
@http_verb.setter
128128
def http_verb(self, val: Optional[str]) -> None:
129129
"""Sets HTTP method to Dapr invocation request."""
130-
if val not in self.HTTP_METHODS:
130+
if val is not None and val not in self.HTTP_METHODS:
131131
raise ValueError(f'{val} is the invalid HTTP verb.')
132132
self._http_verb = val
133133

daprdocs/content/en/python-sdk-docs/python-actor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ result = await mock_actor.recieve_reminder(name, state, due_time, period, _ttl)
104104

105105
**To allow for more fine-grained control, the `_on_activate` method will not be called automatically the way it is when Dapr initializes a new Actor instance. You should call it manually as needed as part of your tests.**
106106

107+
**A current limitation of the mock actor system is that it does not call the `_on_pre_actor_method` and `_on_post_actor_method` methods. You can always call these methods manually as part of a test.**
108+
107109
The `__init__`, `register_timer`, `unregister_timer`, `register_reminder`, `unregister_reminder` methods are all overwritten by the MockActor class that gets applied as a mixin via `create_mock_actor`. If your actor itself overwrites these methods, those modifications will themselves be overwritten and the actor will likely not behave as you expect.
108110

109111
*note: `__init__` is a special case where you are expected to define it as*

examples/workflow/task_chaining.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def task_chain_workflow(ctx: wf.DaprWorkflowContext, wf_input: int):
3131
return [result1, result2, result3]
3232

3333

34-
@wfr.activity(name='step10')
34+
@wfr.activity(name='step1')
3535
def step1(ctx, activity_input):
3636
print(f'Step 1: Received input: {activity_input}.')
3737
# Do some work

tools/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
grpcio-tools==1.62.3
2+
mypy-protobuf==3.6.0

0 commit comments

Comments
 (0)