ETL
Extract, Transform, and Load
What is ETL?
ETL is a term meaning Extract, Transform, Load. It is used when there a routine for pulling data, cleaning it, and saving/analyzing it. I thin the Prefect Library is great for some simple ETL.
Template for Prefect ETL
This code basically comes from the docs
Tips
Be careful with side effects
When i was struggling with prefect I had code that took used side effects. Side effects, as I understand them are when a function changes something that was not passed to it. In python this is often treated as feature. But using a Prefect @task did not would not do the side effects. My code as a web scraper that would add something to a list. I did not originally pass the list to the function. So the scraper would run, but it would not update the list when the function was run as a prefect task.
I feel like avoiding side effects is a good habit to get into anyway.
I also moved the creation of the empy comment_list
to inside the task. I don't know if this is necessary but I assume it is a best practice.
Furthermore, Please don't judge my use of try: except:
Last updated