Michael Warnock
07/30/2021, 8:50 PMconfig.toml
and secrets added to it becoming available when doing local testing? That appears to be the case, since a missing local secret error went away seemingly magically, as I was preparing to ask about it. Alternatively, I had added the secret to cloud first, so maybe there was a (longer) lag before it found it there, and it's still not using my local-secrets?
Also, SlackTask doesn't work when supplying 'message' at runtime (or directly to run); I get TypeError: run() got multiple values for argument 'message'
- something to do with that defaults_from_attrs magic?Kevin Kho
.flow.run()
, I think adding a secret to cloud should be quick for the most part as well.
About the SlackTask, supplying the message at runtime should work, could you share how you used it?Michael Warnock
07/30/2021, 8:54 PM>>> from prefect.tasks.notifications import SlackTask
>>> st = SlackTask()
>>> st.run('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/momerath/python-venvs/ford-prefect/lib/python3.8/site-packages/prefect/utilities/tasks.py", line 441, in method
return run_method(self, *args, **kwargs)
TypeError: run() got multiple values for argument 'message'
>>> st = SlackTask('wtf')
>>> st.run()
>>>
Michael Warnock
07/30/2021, 8:54 PMKevin Kho
default_from_attrs
but it can be fixed by supplying the keyword like:
st = SlackTask()
st.run(message='foo')
with Flow('test') as flow:
st("foo")
flow.run()
Just tested and both of these work. (Was able to replicate also)Michael Warnock
07/30/2021, 9:00 PMKevin Kho