How to test your Python ETL pipelines | Data pipeline | Pytest
BI Insights Inc
@biinsightsincAbout
Hi, I am Haq, a Data Analyst and Engineer. On this channel I talk/share tips and tricks on Business Intelligence tools, Data, Data Warehouse and Source Control. I have been involved in many Data Analytics and Process Automation projects. I am passionate about finding new ways and techniques to enhance the Data Analysis process. On this channel I create tutorials for people who: • are looking for a way to learn and use the power of Python in their day-to-day work. • are looking to automate Data Analysis processes using PowerBI, Cognos and Python • want to learn Data Analysis & Data Science to perform impactful analysis. • are working with Data and want to find new ways to of doing things • are looking to use Source Control to house their code If this sounds exciting to you, consider subscribing and turning on the notifications, so you don’t miss any content. Happy Coding everyone. May the power of the code be with you!
Video Description
In this tutorial we are going to cover how to test ETL pipelines. I have received a number of inquiries on the testing and especially testing the data pipelines we build using python. Testing is an important aspect of ETL pipelines. It ensures we are delivering accurate information to our stakeholders. We want to make sure our data is current, consistent and accurate. Therefore, it is always a good idea to put test cases in place to catch data anomalies. A failing test can tell us that; • An assumption about your source data is incorrect. For example, a column we expected never to be null contains nulls or a column we expected to contain unique values contains duplicates. • Testing can catch the flaws in our transformation logic. Errata in the tests: One of the viewers pointed that the null check was always returning true. It has been revised to to return false when nulls are present. test_null_check function is updated as follow: def test_null_check(df): assert df['ProductKey'].notnull().all() Link to GitHub repo (code & data): https://github.com/hnawaz007/pythondataanalysis/tree/main/ETL%20Pipeline/Pytest Link to article on this topic: https://blog.devgenius.io/how-to-test-python-etl-pipelines-c7f9b44af05b Pytest Docs: https://docs.pytest.org/en/7.2.x/ #pytest #etl #python Subscribe to our channel: https://www.youtube.com/c/HaqNawaz --------------------------------------------- Follow me on social media! Github: https://github.com/hnawaz007 Instagram: https://www.instagram.com/bi_insights_inc LinkedIn: https://www.linkedin.com/in/haq-nawaz/ --------------------------------------------- Topics covered in this video: 0:00 - Introduction to ETL testing 0:56 - Benefit of testing 1:32 - Pytest testing library overview 2:26 - Pytest setup 3:05 - Import Data 3:36 - First test - column check 6:08 - Primary key column tests 7:22 - Pytest features 8:15 - Data Type check 9:36 - Expected Values check
Urgent: Craft Terrarium Supplies
AI-recommended products based on this video

Window Herb Planter Box, Clear 10.6 Inch Long Self Watering Plant Pots, Modern Rectangular Herb Pots, Decorative Garden Flower Pots for Indoor Plants, Herbs, Succulent, Vegetables - 3PCS

LaLaGreen Wall Planters - 16 Inch Wall Planters for Indoor Plants, 3 Tier Galvanized Succulent Wall Mounted Planters, Metal Boho Window Herb Garden, Rectangle Hanging Vertical Shelf Shower Plant Pot

Victorinox SwissCard – Small Replacement Tweezers A.6142-X1, Silver

Soleilwear Mini Electric Screwdriver Set, 52 in 1 Precision Electric Screwdriver Cordless with 48 Magnetic Bits, Repair Tool Kit with Tweezers and Pry Bar

TapeGeeks Nasal Strips for Kids Nose Strips for Breathing Nasal Strip for Reducing Snoring Boys and Girls, Mix Colors

Flip 7 - Card Game Mix of Luck and Strategy, Fast-Paced Addictive Card Game, Quick to Learn and Easy to Teach, 3+ Players, Ages 8 & Up, 20 Minutes Play Time

NESTEA Mixed Berry Iced Tea Mix, Made With Real Tea and Infused With Berry Flavour, No Artificial Flavours or Sweeteners, Prepared in Canada, Reclosable Canister, 650 g






