Python Decorators: Streamlining Logging in Your Functions

Python's logging module is an excellent tool for tracking the activities of a script. For instance, if you want to log the start of a function, its parameters, return values, and completion, you can manually insert logging calls at appropriate places within the function. But what if you need to add these logs to every… Continue reading Python Decorators: Streamlining Logging in Your Functions

NANP and Phone Number Normalization: Securing Data for Comparison

Let's say two people have their own lists of client email addresses. They want to know how many email addresses they have in common, but do not want to share the whole email addresses to each other. They do not also want to share their email addresses to a 3rd person. How can they compare… Continue reading NANP and Phone Number Normalization: Securing Data for Comparison

ISO-8601 Week Definition: Is January 1st, 2023 the Last Week of 2022?

Top View Of A Person At A Grey Desk With Calendar, Laptop, Cactus And Coffee by AtlasStudio from NounProject.com

Is January 1st, 2023 (Sunday) the 1st week of 2023 or the last week of 2022? At first glance, this looks like a very simple question but actually it is not. Because "a week is a period of 7 days" is the only definition we have about a week. Does a week start on Sunday?… Continue reading ISO-8601 Week Definition: Is January 1st, 2023 the Last Week of 2022?

Solving Max and Min Value Problems with SQL Window Functions

While working with databases, we might be in a situation to solve the problems related with handling max values or min values. "What product has been sold at highest price in last 5 years?", "Since 2000, who has hit the most home-runs in a season and which year was it?" or "On which date each… Continue reading Solving Max and Min Value Problems with SQL Window Functions

Enhance Airflow Task Monitoring with Custom Callback Functions and Webhooks

Although Airflow can send an email upon task failure, sometime it's not good enough for you. You may have other kind of communication channels like Slack, or you may just want to post it to the SNS like Twitter. In this case, on_success_callback and on_failure_callback could be a good choice. These callback functions are called… Continue reading Enhance Airflow Task Monitoring with Custom Callback Functions and Webhooks

Understanding Airflow Job Scheduling: Timetable Concept Explained

Apache Airflow is a platform to programmatically author, schedule and monitor workflows. For whom has lots of scheduled jobs to run, Airflow is quite a mind-blowing platform. Although it also has some weird points, I think the good overcomes the bad. Among the many characteristics of Airflow, let's focus on job scheduling here. Actually, setting… Continue reading Understanding Airflow Job Scheduling: Timetable Concept Explained