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

List index out of range on field type #9

Closed
robmoore opened this issue Apr 3, 2019 · 2 comments · Fixed by #11
Closed

List index out of range on field type #9

robmoore opened this issue Apr 3, 2019 · 2 comments · Fixed by #11

Comments

@robmoore
Copy link

robmoore commented Apr 3, 2019

I'm using the Posgres tap and am running into issues with a reference to the type property on the field reference (line 73: schema_type = field['type'][1]).

INFO Stream db-ds-site is using incremental replication with replication key last_update_date
Traceback (most recent call last):
  File "/home/rob/python-virtual-env/target-bigquery/bin/target-bigquery", line 10, in <module>
    sys.exit(main())
  File "/home/rob/python-virtual-env/target-bigquery/lib/python3.6/site-packages/target_bigquery.py", line 300, in main
    state = persist_lines_stream(config['project_id'], config['dataset_id'], input, validate_records=validate_records)
  File "/home/rob/python-virtual-env/target-bigquery/lib/python3.6/site-packages/target_bigquery.py", line 239, in persist_lines_stream
    tables[table] = bigquery.Table(dataset.table(table), schema=build_schema(schemas[table]))
  File "/home/rob/python-virtual-env/target-bigquery/lib/python3.6/site-packages/target_bigquery.py", line 100, in build_schema
    schema_name, schema_type, schema_mode, schema_description, schema_fields = define_schema(schema['properties'][key], key)
  File "/home/rob/python-virtual-env/target-bigquery/lib/python3.6/site-packages/target_bigquery.py", line 73, in define_schema
    schema_type = field['type'][1]
IndexError: list index out of range

I generated the properties.json I'm using with the Postgres tap.

I've successfully run this Postgres tap using a CSV target.

I haven't enabled the stream_data config setting in my configuration for the target.

I tried using the exchangeratesapi tap but I get a different error.

@craigmulligan
Copy link
Contributor

craigmulligan commented Jul 29, 2019

I also just hit the same error using postgres tap. Any insights?

@craigmulligan
Copy link
Contributor

Figured it out - looks like it may solve #10 too. Will try to submit a PR shortly.

craigmulligan added a commit to team-blaze/target-bigquery that referenced this issue Jul 30, 2019
craigmulligan added a commit to team-blaze/target-bigquery that referenced this issue Jul 30, 2019
herregroen pushed a commit to Yoast/target-bigquery that referenced this issue Feb 17, 2021
…guous-types

default to the last item type like previously
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

Successfully merging a pull request may close this issue.

2 participants