Skip to content

Instantly share code, notes, and snippets.

@filippchistiakov
Created July 4, 2019 15:05
Show Gist options
  • Save filippchistiakov/dcebd80433aab6eace4fba0c968f7446 to your computer and use it in GitHub Desktop.
Save filippchistiakov/dcebd80433aab6eace4fba0c968f7446 to your computer and use it in GitHub Desktop.
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.models import Variable
from parser_reviews_yandex_maps import parser_reviews
args = {'owner': 'philipp', 'start_date': '2019-06-26', 'catchup' :False, 'max_active_runs' :1}
url = 'https://yandex.ru/maps/org/yandex/123123/'
parser_reviews_dag = DAG(
"parser_reviews",
schedule_interval="0 * * * *",
default_args=args,
)
def parser_start(**kwargs):
parser_reviews(url)
parser_reviews_task = PythonOperator(
task_id="yandex_reviews",
python_callable=parser_start,
dag=parser_reviews_dag,
provide_context=True,
op_kwargs={
"url": url,
},
)
parser_reviews_task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment