Skip to content

Instantly share code, notes, and snippets.

@Geremie
Created April 18, 2022 21:00
Show Gist options
  • Select an option

  • Save Geremie/484567dbfe447995a0fd82529ed95bd9 to your computer and use it in GitHub Desktop.

Select an option

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)
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