[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-534040664 @mik-laj I think we stalled working out whether to try and fix the PR, or just deprecate the behaviour. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-521613826 Yeah, this probably can be changed and tieded up now. We'll probably have to fix a lot of our own unit tests that create Operators without DAGs, but a single central helper/base test class would make that a lot less painful. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-521609959 Maybe with the context manager (`with DAG:`) that is doable now, but I suspect this feature existed to support "task" factories, sort of like this. ``` dag = DAG() for task in generate_tasks(): task.dag = dag ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-516807208 Argh. This works, except for when the DAG is pickled. Grr. (Maybe we just delete dag pickling first?) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-512348463 @milton0825 I've thought of an edge-case with this approach: ```python op1 = BashOperator(task_id='test_op_1', bash_command='true') op1.bash_command = 'date' op1.dag = dag ``` This would end up with the bash_command being re-set to `'true'`. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-512328509 I've got the scoping of the closure wrong. Given this case ``` op1 = DummyOperator(task_id='test_op_1', owner='test') op2 = DummyOperator(task_id='test_op_2', owner='test') op3 = DummyOperator(task_id='test_op_3', owner='test', dag=dag) op4 = DummyOperator(task_id='test_op_4', owner='test', dag=dag2) op1.dag = dag ``` It is re-applying the args passed to the last invocation of the decorator, so op4's args :( This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-511789349 Though it looks like this changes _quite a lot_ of behaviour that the tests were relying on. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [airflow] ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op`
ashb commented on issue #5598: [AIRFLOW-733][AIRFLOW-883] Apply default_args when setting `op.dag = dag` or `dag >> op` URL: https://github.com/apache/airflow/pull/5598#issuecomment-511765582 @milton0825 As discussed. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services