Comments (3)
Good observation, I'll take this on
from azure-functions-durable-python.
I fixed start_new
here: #93
Judging from call_activity
's signature, it appears to already work. Below is a snippet showing that we already provide default values, note the i=None
from DurableOrchestrationContext.py
:
self.call_activity = lambda n, i=None: call_activity_task(
state=self.histories,
name=n,
input_=i)
self.call_activity_with_retry = \
lambda n, o, i=None: call_activity_with_retry_task(
state=self.histories,
retry_options=o,
name=n,
Please let me know what you think
from azure-functions-durable-python.
Just triple checked, and this (call_activity
with no input) already works, provided that the called Activity has a default value.
You can reproduce this yourself by modifying the function_chaining
sample as follows:
The new DurableActivity.py
:
def main(name: str="Bob") -> str:
"""Activity function performing a specific step in the chain
Parameters
----------
name : str
Name of the item to be hello'ed at
Returns
-------
str
Returns a welcome string
"""
return f'Hello : {name}!'
The new DurableOrchestration
:
import logging
import azure.functions as func
import azure.durable_functions as df
def orchestrator_function(context: df.DurableOrchestrationContext):
"""This function provides the core function chaining orchestration logic
Parameters
----------
context: DurableOrchestrationContext
This context has the past history
and the durable orchestration API's to chain a set of functions
Returns
-------
final_result: str
Returns the final result after the chain completes
Yields
-------
call_activity: str
Yields at every step of the function chain orchestration logic
"""
# Chained functions - output of a function is passed as
# input to the next function in the chain
# Note, in this case, there's no actual chaining
final_result = yield context.call_activity("DurableActivity")
return final_result
main = df.Orchestrator.create(orchestrator_function)
I'll close this issue, for now. Please feel free to re-open it if necessary π
from azure-functions-durable-python.
Related Issues (20)
- Support instanceIdPrefix for DurableOrchestrationClient.get_status_by
- binding <name> has invalid non-type annotation list[str] HOT 2
- Question: How to pass data between Azure http_trigger to FastAPI endpoint
- purge_instance_history_by raises exception when optional created_time_from is not passed
- Object of type async_generator is not JSON serializable when calling sub-orchestrator HOT 2
- The durable function is stuck in the βrunningβ state forever HOT 5
- DurableOrchestrationContext call_http does not work with string input HOT 1
- Nothing changed, pinned versions, functions still broke at some point in time HOT 4
- Package is accidentally shipping its tests
- AttributeError: 'dict' object has no attrbute 'state' when running Orchestrator function HOT 6
- `call_http` json serializes regular `str` content. HOT 5
- azure_functions_worker logging shows wrong programming model HOT 1
- Durable Function Error when accessing Blob Storage behind Private Endpoint HOT 2
- Events added to in-memory queue are not being removed after wait_for_external_event consumes it HOT 4
- Routing/URL matching precedence is ignored
- How to properly pass input arguments to a sub-orchestration function?
- Known regression: Activity input fails to deserialize when the input is an array
- Add call_activity_with_retry to DurableOrchestrationContext class
- Object of type generator is not JSON serializable error in orchestrator function
- Please support the underscore character as a binding name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-functions-durable-python.