You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by Aaron Polhamus <aa...@credijusto.com> on 2017/07/28 16:00:38 UTC

Possible bug in bitshift operator?

I've run into an issue using bitshift operators to define task dependencies
in my DAG (this question is here
<https://stackoverflow.com/questions/45362880/reversed-upstream-downstream-relationships-when-generating-multiple-tasks-in-air>
on StackOverflow as well).

I've pasted code in, below. What this looks like it *should* do is that
preproc_task will run first, followed by clear_tables. What it actually
*does* do, which is the behavior that I want to it have, is run
clear_tables first, followed by parallel execution of a bunch of
preproc_task operations defined by different user IDs.

The dependency relationship seems like it's reversed. I'm choosing between
proper syntax and the wrong behavior and improper syntax and the right
behavior. How can I debug this?

from datetime import datetimeimport osimport sys
from airflow.models import DAGfrom airflow.operators.python_operator
import PythonOperator
import ds_dependencies

SCRIPT_PATH = os.getenv('DASH_PREPROC_PATH')if SCRIPT_PATH:
    sys.path.insert(0, SCRIPT_PATH)
    import dash_workerselse:
    print('Define DASH_PREPROC_PATH value in environmental variables')
    sys.exit(1)

ENV = os.environ

default_args = {
  'start_date': datetime.now(),}

DAG = DAG(
  dag_id='dash_preproc',
  default_args=default_args)

clear_tables = PythonOperator(
  task_id='clear_tables',
  python_callable=dash_workers.clear_db,
  dag=DAG)
def id_worker(uid):
    return PythonOperator(
        task_id=id,
        python_callable=dash_workers.main_preprocess,
        op_args=[uid],
        dag=DAG)
for uid in dash_workers.get_id_creds():
    preproc_task = id_worker(uid)
    clear_tables << preproc_task


-- 


*Aaron Polhamus*
*Director of Data Science *

Cel (México): +52 (55) 1951-5612
Cell (USA): +1 (206) 380-3948
Tel: +52 (55) 1168 9757 - Ext. 181

-- 
***Por favor referirse a nuestra página web 
<https://www.credijusto.com/aviso-de-privacidad/> para más información 
acerca de nuestras políticas de privacidad.*