Jack P
03/13/2024, 5:00 PMCrash
state, but instead Completed
?parker
03/13/2024, 5:17 PMFrantišek
03/13/2024, 5:40 PMSodaman
03/13/2024, 7:38 PMLarry Profx
03/14/2024, 3:28 AMKrystal
03/14/2024, 10:22 AMKrystal
03/14/2024, 1:58 PMnodeSelector
in the infra overwrite?Larry Profx
03/14/2024, 5:49 PMAlex Papanicolaou
03/14/2024, 6:50 PMErik Osinga
03/14/2024, 7:49 PMAndreas Nord
03/14/2024, 9:03 PMBryan
03/14/2024, 11:27 PMmondras
03/14/2024, 11:30 PMTask parameter introspection took 19.636 seconds , exceeding `PREFECT_TASK_INTROSPECTION_WARN_THRESHOLD` of 10.0. Try wrapping large task parameters with `prefect.utilities.annotations.quote` for increased performance, e.g. `my_task(quote(param))`. To disable this message set `PREFECT_TASK_INTROSPECTION_WARN_THRESHOLD=0`
Bryan
03/14/2024, 11:43 PMmassumo
03/15/2024, 8:07 AMAndrei Rediu
03/15/2024, 2:21 PMAndreas Nord
03/15/2024, 4:29 PMLielA
03/15/2024, 5:38 PMAusten
03/15/2024, 8:05 PMMarvin
03/17/2024, 5:43 PMRetrying()
or Failed()
.
2. Use the state_handlers
parameter of the @task
decorator to attach your hook function to the task.
3. Inside your hook function, you can implement any action you desire, such as waiting for another event or sending a notification.
Since the provided documentation excerpts and the code example didn't contain the information we're looking for to fully answer your question, you may need to dig deeper into the Prefect documentation or community examples involving state_handlers
, specifically for task retries.
Alternatively, you can look into Prefect's task retry mechanism itself and see if it's possible to integrate hooks directly within the retry strategy or attach handlers that are triggered upon every retry attempt due to failure.
To get started with hooks in Prefect, here is a simplified Python example based on the concept of state change hooks:
python
from prefect import flow, task
from prefect.engine.state import Retrying
@task(state_handlers=[your_retry_handler])
def my_task():
# your task implementation
def your_retry_handler(task, old_state, new_state):
if isinstance(new_state, Retrying):
# Perform your action here, such as sending a notification
pass
return new_state
@flow
def my_flow():
my_task()
if __name__ == "__main__":
my_flow()
Replace your_retry_handler
with the appropriate function that defines the action to take on each retry due to failure.
Please note that this is a general guide, and the actual implementation may vary according to Prefect's current API and best practices. For more specific examples, you can browse through Prefect's community code examples on GitHub, forums, or consult the official documentation on state change hooks for detailed guidance.Charles Marks
03/17/2024, 5:43 PMAlan
03/18/2024, 12:01 AMFile "/opt/anaconda/lib/python3.8/site-packages/httpcore/_backends/anyio.py", line 69, in start_tls
ssl_stream = await anyio.streams.tls.TLSStream.wrap(
File "/opt/anaconda/lib/python3.8/site-packages/anyio/streams/tls.py", line 123, in wrap
await wrapper._call_sslobject_method(ssl_object.do_handshake)
File "/opt/anaconda/lib/python3.8/site-packages/anyio/streams/tls.py", line 131, in _call_sslobject_method
result = func(*args)
File "/opt/anaconda/lib/python3.8/ssl.py", line 944, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError:
Ryan Peden
03/18/2024, 1:05 AMKaleb King
03/18/2024, 2:58 PMAndreas Nord
03/18/2024, 3:00 PMJoe D
03/18/2024, 4:35 PMBlake
03/18/2024, 5:44 PMJason Wiener
03/18/2024, 10:12 PMSrujan Jabbireddy
03/19/2024, 3:37 AMMike O'Connor
03/19/2024, 10:10 AM