Created
April 18, 2022 21:00
-
-
Save Geremie/484567dbfe447995a0fd82529ed95bd9 to your computer and use it in GitHub Desktop.
If you are using Python and Google Cloud Platform, this will Simplify Life for you (Part 2)
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
| def print_haversine(): | |
| from mypythonlib import myfunctions | |
| x1, y1, x2, y2 = 1, 2, 3, 4 | |
| haversine_distance = myfunctions.haversine(x1, y1, x2, y2) | |
| print(f'The haversine distance between ({x1}, {y1}) and ({x2}, {y2}) est {haversine_distance}') | |
| dag = DAG('haversine-distance-dag', | |
| default_args=DEFAULT_ARGS, | |
| schedule_interval=None, | |
| catchup=False) | |
| with dag: | |
| print_haversine_task = PythonOperator( | |
| task_id='print-haversine-distance', | |
| python_callable=print_haversine | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment