Skip to content

Instantly share code, notes, and snippets.

@discdiver
Created August 2, 2022 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save discdiver/795a0bd0d6570edfde010f5da38f8885 to your computer and use it in GitHub Desktop.
Save discdiver/795a0bd0d6570edfde010f5da38f8885 to your computer and use it in GitHub Desktop.
Wrote {'data': 42, 'message': 'Super Special Message'} to database successfully!
Or
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
/Users/jeffhale/Desktop/prefect/prefect-101/p101.ipynb Cell 5 in <cell line: 1>()
----> 1 pipeline1(msg="Super Special Message")
/Users/jeffhale/Desktop/prefect/prefect-101/p101.ipynb Cell 5 in pipeline1(msg)
19 def pipeline1(msg: str):
---> 20 api_result = call_unreliable_api()
21 augmented_data = augment_data(data=api_result, msg=msg)
22 write_results_to_database(augmented_data)
/Users/jeffhale/Desktop/prefect/prefect-101/p101.ipynb Cell 5 in call_unreliable_api()
6 res = random.choice(choices)
7 if res == "failure":
----> 8 raise Exception("Our unreliable service failed")
9 else:
10 return res
Exception: Our unreliable service failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment