Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: tuple indices must be integers or slices, not str #5

Open
jensenity opened this issue Jun 19, 2018 · 0 comments
Open

TypeError: tuple indices must be integers or slices, not str #5

jensenity opened this issue Jun 19, 2018 · 0 comments

Comments

@jensenity
Copy link

[2018-06-19 11:44:18,462] {models.py:1595} ERROR - tuple indices must be integers or slices, not str
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/airflow/models.py", line 1488, in _run_raw_task
result = task_copy.execute(context=context)
File "/usr/local/airflow/dags/productdata/ops/mysql_to_s3_operator.py", line 86, in execute
self.get_schema(hook, self.mysql_table)
File "/usr/local/airflow/dags/productdata/ops/mysql_to_s3_operator.py", line 94, in get_schema
new_dict['name']=i['COLUMN_NAME']
TypeError: tuple indices must be integers or slices, not str

There's an error if the tuple is a str.

When I change it to
[As-Is]

new_dict['name']=i['COLUMN_NAME']

new_dict['type']=i['COLUMN_TYPE']

[To-Be]
new_dict['name']=i[0] # COLUMN_NAME
new_dict['type']=i[1] # COLUMN_TYPE

No more error is shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant