1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Pipelines

Exercise

Logging within a data pipeline

In this exercise, we'll take a look back at the function you wrote in a previous video and practice adding logging to the function. This will help when troubleshooting errors or making changes to the logic!

pandas has been imported as pd. In addition to this, the logging module has been imported, and the default log-level has been set to "debug".

Instructions

100 XP
  • Create an info-level log after the transformation, passing the string: "Transformed 'Order Date' column to type 'datetime'."
  • Log the .shape of the DataFrame at the debug-level before and after filtering.