Byte Ebi's Logo

Byte Ebi 🍤

A Bit everyday A Byte every week

A DAG as a Variable Desk

Designated parameter changes at the desk. All other variables, not our department.

Ray

The requesting team wants to tweak a parameter whenever they need to, without going through an engineer every time.
Giving them a database table to edit is a maintenance burden, and Airflow Variables can’t be opened up one at a time.
I don’t want to grant overly broad permissions, and I don’t want to be on call to change a value either. So what now?

Triggering Airflow DAG from Another

Use operator to easily trigger downstream DAGs in Airflow

Ray

When building dependencies between DAGs, you don’t always have to rely on RESTful APIs.
Airflow also provides a built-in Operator for this purpose.

Manage Python Versions with Pyenv

End the mess of switching Python versions.

Ray

Pyenv is a tool for managing different Python versions.
Whether you’re upgrading a project to a newer Python release or switching between projects with different requirements, pyenv makes the process simple and hassle-free.

[Pytest 101] 04 Mock Class

An introduction to two approaches for testing class instantiation when using the Factory Pattern, with practical examples using pytest-mock.

Ray

Introducing the factory pattern in your code can significantly improve its structure—but it also makes unit testing a bit trickier.
We’ll walk through two different mocking strategies, compare their pros and cons, and help you write more robust tests!

[Pytest 101] 03 Mock SQL Query

Free your unit tests from database dependencies using mocks.

Ray

With mock objects, we can simulate database operations without actually connecting to a real database.
This means we don’t need to prepare a dedicated test database or worry about cleaning it up after tests.

Recent Posts

Categories

Tags