bryzgaloff / airflow-clickhouse-plugin

The most popular ClickHouse plugin for Airflow. 🔝 Top-1% downloads on PyPI: https://pypi.org/project/airflow-clickhouse-plugin! Based on mymarilyn/clickhouse-driver.
MIT License
144 stars 36 forks source link

DAG object hass no attribute update_relative #55

Closed programmeddeath1 closed 1 year ago

programmeddeath1 commented 1 year ago

Iv installed clickhouse plugin and am trying to run the example mysql to clickhouse

The DAG is giving error

  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/taskmixin.py", line 238, in set_upstream
    self._set_relatives(task_or_task_list, upstream=True, edge_modifier=edge_modifier)
  File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/taskmixin.py", line 175, in _set_relatives
    task_object.update_relative(self, not upstream)
AttributeError: 'DAG' object has no attribute 'update_relative'

Im on python 3.7 and airflow 2.4.3

Can anyone help me figure out what the issue is? Thanks in advance!

programmeddeath1 commented 1 year ago

Is an airflow version issue, can add dag as a parameter in operator

        task_id='mysql_to_clickhouse',
        python_callable=mysql_to_clickhouse,
        dag=dag,
    )

or just remove DAG >>. As airflow handles it by directly allocating operator to DAG.