Created
June 6, 2021 18:08
-
-
Save nickefy/401e84cb3a37ccd0711f136fb0bff6c3 to your computer and use it in GitHub Desktop.
Airflow Operator without Framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow.models import BaseOperator | |
from airflow.utils.decorators import apply_defaults | |
from os import environ | |
class PrintText(BaseOperator): | |
@apply_defaults | |
def __init__( | |
self, | |
text_to_print, | |
*args, **kwargs): | |
super(PrintText, self).__init__(*args, **kwargs) | |
self.text_to_print = text_to_print | |
def __print_text(self): | |
print(text_to_print) | |
def execute(self, context): | |
self.__print_text() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment