title: How to trigger operator inside Python function using Airflow?
body: <p>I have the following code:</p>
  
  <pre><code>def chunck_import(**kwargs):
      ...
      for i in range(1, num_pages + 1):
          start = lower +  chunks * i
          end = start + chunks
          if i&gt;1:
               start = start + 1
          logging.info(start, end)
          if end &gt; max_current:
              end = max_current
          where = 'where orders_id between {0} and {1}'.format(start,end)
          logging.info(where)
          import_orders_products_op = MySqlToGoogleCloudStorageOperator(
              task_id='import_orders_and_upload_to_storage_orders_products_{}'.format(i),
              mysql_conn_id='mysql_con',
              google_cloud_storage_conn_id='gcp_con',
              provide_context=True,
              approx_max_file_size_bytes = 100000000, #100MB per file
              sql = 'import_orders.sql',
              params={'WHERE': where},
              bucket=GCS_BUCKET_ID,
              filename=file_name_orders_products,
              dag=dag)
  
      start_task_op = DummyOperator(task_id='start_task', dag=dag)
  
      chunck_import_op = PythonOperator(
          task_id='chunck_import',
          provide_context=True,
          python_callable=chunck_import,
          dag=dag)
  
      start_task_op &gt;&gt;  chunck_import_op
  </code></pre>
  
  <p>This code uses <code>PythonOperator</code> to calculate how many runs I need from the <code>MySqlToGoogleCloudStorageOperator</code> and create the <code>WHERE</code> cluster of the SQL then it needs to execute it.</p>
  
  <p>The problem is that the <code>MySqlToGoogleCloudStorageOperator</code> isn't being executed.</p>
  
  <p>I can't actually do </p>
  
  <pre><code>chunck_import_op &gt;&gt; import_orders_products_op
  </code></pre>
  
  <p>How can I make the <code>MySqlToGoogleCloudStorageOperator</code> be executed inside the <code>PythonOperator</code>?</p>