Open for discussion about Prefect's Core engine: https://github.com/PrefectHQ/prefect
import prefect
from prefect import Flow, Parameter, task
@task
def say_hello(name):
print(f"Hello, {name}!")
def main():
with Flow("My First Flow") as flow:
twitter_user = Parameter("twitter_user")
# tweet_id = Parameter("tweet_id", required=False)
say_hello(twitter_user)
flow_context = dict()
with prefect.context(flow_context):
# run the flow
state = flow.run(parameters=dict(
twitter_user="Josh"
# tweet_id="1046873748559814656"
))
if __name__ == '__main__':
main()
Traceback (most recent call last):
File "first-flow.py", line 30, in <module>
main()
File "first-flow.py", line 25, in main
tweet_id="1046873748559814656"
File "/Users/josh/Envs/prefect/lib/python3.6/site-packages/prefect/core/flow.py", line 976, in run
fmt_params
ValueError: Flow.run received the following unexpected parameters: tweet_id
flow.add_task(tweet_id)
say_hello
hey everyone! In case you haven't seen, by popular request we are going to migrate our public discussions to Slack for better history / organization: https://t.co/UyS12hy3mO
I'll leave the gitter open for a while to reroute people there
LocalExecutor
(https://docs.prefect.io/api/unreleased/engine/executors.html#localexecutor)
DaskExecutor
which supports asynchronous execution (some relevant docs here: https://docs.prefect.io/guide/tutorials/dask-cluster.html), but let me know if I misunderstood your question!
Hi! I am writing a custom notifier and want to output the input-arguments of my task. For example, I want to send to slack p_table_name
@task
def make_query_for_columns(p_table_name) -> str:
my handler:
def my_state_handler(obj: TrackedObjectType, old_state: "prefect.engine.state.State",
new_state: "prefect.engine.state.State"):
Can you tell us how to do this?