mikeghen / airflow-tutorial

Use Airflow to move data from multiple MySQL databases to BigQuery
Apache License 2.0
99 stars 21 forks source link

Byte-like object required error #1

Open TiaMotsoane opened 6 years ago

TiaMotsoane commented 6 years ago

I am getting the following error when runnig this.

[2018-01-04 11:12:23,372] {models.py:1342} INFO - Executing on 2018-01-04 00:00:00

[2018-01-04 11:12:23,400] {base_hook.py:67} INFO - Using connection to: 35.189.207.140

[2018-01-04 11:12:24,903] {models.py:1417} ERROR - a bytes-like object is required, not 'str'

Traceback (most recent call last):

File "/home/hyperli/.local/lib/python3.5/site-packages/airflow/models.py", line 1374, in run result = task_copy.execute(context=context)

File "/home/hyperli/.local/lib/python3.5/site-packages/airflow/contrib/operators/mysql_to_gcs.py", line 91, in execute

files_to_upload = self._write_local_data_files(cursor)

File "/home/hyperli/.local/lib/python3.5/site-packages/airflow/contrib/operators/mysql_to_gcs.py", line 136, in _write_local_data_files

json.dump(row_dict, tmp_file_handle)

File "/usr/lib/python3.5/json/init.py", line 179, in dump fp.write(chunk)

File "/usr/lib/python3.5/tempfile.py", line 622, in func_wrapper return func(*args, **kwargs)

TypeError: a bytes-like object is required, not 'str'

carillpower commented 6 years ago

Hi Mike,

I also face the same error, could you care to help?

mikeghen commented 5 years ago

@TiaMotsoane @carillpower, just saw your issues today. I am going to push some updates this week ahead of a conference I am attending, check back in a week and hopefully this will be resolved. Thank you both for commenting on the repo, I'm sure this is something related to this repo being a little out of date, stay tuned

saikrishna2733 commented 5 years ago

Hi Mikeghen,

Thanks for the nice documentation. I am actually facing an error while executing MySQL_GCP.py DAG file. Request you to kindly help me in resolving the issue. Issue Description : Broken DAG: [/usr/local/lib/python2.7/dist-packages/airflow/example_dags/mysql_to_gcs.py] No module named google.auth