Skip to content

Commit 6dd9ac1

Browse files
authored
Fix Activity Input check (#13)
Signed-off-by: Deepanshu Agarwal <deepanshu.agarwal1984@gmail.com>
1 parent 4046191 commit 6dd9ac1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- Add gRPC metadata option ([#16](https://github.com/microsoft/durabletask-python/pull/16)) - contributed by [@DeepanshuA](https://github.com/DeepanshuA)
66

7+
### Fixed
8+
9+
- Fix zero argument values sent to activities as None ([#13](https://github.com/microsoft/durabletask-python/pull/13)) - contributed by [@DeepanshuA](https://github.com/DeepanshuA)
10+
711
### Changes
812

913
- Removed Python 3.7 support due to EOL ([#14](https://github.com/microsoft/durabletask-python/pull/14)) - contributed by [@berndverst](https://github.com/berndverst)

durabletask/worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def call_activity(self, activity: Union[task.Activity[TInput, TOutput], str], *,
370370
input: Union[TInput, None] = None) -> task.Task[TOutput]:
371371
id = self.next_sequence_number()
372372
name = activity if isinstance(activity, str) else task.get_name(activity)
373-
encoded_input = shared.to_json(input) if input else None
373+
encoded_input = shared.to_json(input) if input is not None else None
374374
action = ph.new_schedule_task_action(id, name, encoded_input)
375375
self._pending_actions[id] = action
376376

@@ -386,7 +386,7 @@ def call_sub_orchestrator(self, orchestrator: task.Orchestrator[TInput, TOutput]
386386
if instance_id is None:
387387
# Create a deteministic instance ID based on the parent instance ID
388388
instance_id = f"{self.instance_id}:{id:04x}"
389-
encoded_input = shared.to_json(input) if input else None
389+
encoded_input = shared.to_json(input) if input is not None else None
390390
action = ph.new_create_sub_orchestration_action(id, name, instance_id, encoded_input)
391391
self._pending_actions[id] = action
392392

0 commit comments

Comments
 (0)