Skip to content

Commit

Permalink
More changes to ES examples
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcash committed Aug 31, 2021
1 parent cbd4380 commit f846d85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions airflow_home/dags/elasticsearch_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@


def show_tables():
"""
show_tables queries elasticsearch to list available tables
"""
es = ElasticsearchHook(elasticsearch_conn_id='production-es')
with es.get_conn() as es_conn:
tables = es_conn.execute('SHOW TABLES')
Expand All @@ -30,11 +33,11 @@ def show_tables():
max_active_runs=1,
schedule_interval=timedelta(days=1), # https://airflow.apache.org/docs/stable/scheduler.html#dag-runs
default_args=default_args,
catchup=False # enable if you don't want historical dag runs to run
catchup=False
) as dag:


tn = PythonOperator(
es_tables = PythonOperator(
task_id=f'es_print_tables',
python_callable=show_tables
)

0 comments on commit f846d85

Please sign in to comment.