11
Pragmatic Designs: Argument Passing in Airflow’s Operator Inheritance

Pragmatic Designs: Argument Passing in Airflow’s Operator Inheritance

5 years ago
Anonymous $syBn1NGQOq

https://medium.com/@tszumowski/pragmatic-designs-argument-passing-in-airflows-operator-inheritance-b524a585a9f6

You ever find yourself needing to pass configuration parameters around a code base with many classes or methods? — I do, all the time. One simple approach in Python is create a config dictionary and pass it through everywhere. Any object that needs it can use the specific keys it is interested. But as demonstrated in this example, that can be a rather dangerous practice.

This is where you may find the use of args and kwargs mentioned for Python. As written by a args **kwargs tutorial by DigitalOcean here: “When programming, you may not be aware of all the possible use cases of your code, and may want to offer more options for future programmers working with the module, or for users interacting with the code.”