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

[Bug] Bigquery fails on stg_qualtrics__distribution_contact #3

Closed
2 of 4 tasks
davejroth opened this issue Dec 22, 2023 · 4 comments · Fixed by #4
Closed
2 of 4 tasks

[Bug] Bigquery fails on stg_qualtrics__distribution_contact #3

davejroth opened this issue Dec 22, 2023 · 4 comments · Fixed by #4
Assignees
Labels
error:forced priority:p3 Affects many users; can wait status:in_progress Currently being worked on type:bug Something is broken or incorrect update_type:documentation Primary focus requires documentation updates

Comments

@davejroth
Copy link

davejroth commented Dec 22, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

dbt throws an error when building stg_qualtrics__distribution_contact. I believe the issue is that the model contains a column named status which is a reserved keyword in bigquery. I was able to successfully build the model by replacing line 38 with status as response_status.

Relevant error log or model output

17:33:01  1 of 1 START sql table model prod_qualtrics_source.stg_qualtrics__distribution_contact  [RUN]
17:33:06  Unhandled error while executing target/run/qualtrics_source/models/stg_qualtrics__distribution_contact.sql
400 PATCH https://bigquery.googleapis.com/bigquery/v2/projects/alder-aim/datasets/prod_qualtrics_source/tables/stg_qualtrics__distribution_contact?prettyPrint=false: The description for field status is too long. The maximum length is 1024 characters.
17:33:06  1 of 1 ERROR creating sql table model prod_qualtrics_source.stg_qualtrics__distribution_contact  [ERROR in 5.23s]
17:33:06  
17:33:06  Finished running 1 table model in 0 hours 0 minutes and 13.39 seconds (13.39s).
17:33:06  
17:33:06  Completed with 1 error and 0 warnings:
17:33:06  
17:33:06    400 PATCH https://bigquery.googleapis.com/bigquery/v2/projects/alder-aim/datasets/prod_qualtrics_source/tables/stg_qualtrics__distribution_contact?prettyPrint=false: The description for field status is too long. The maximum length is 1024 characters.

Expected behavior

the model should materialize without an error

dbt Project configurations

I tried aliasing the column using the instructions provided in the git repo but it is not working:

models:
  +persist_docs:
    relation: true
    columns: true
  warehouse:
    +materialized: table
    staging:
      +schema: staging
vars:
    qualtrics__distribution_contact_pass_through_columns:
    - name: "status"
      alias: "response_status"

Package versions

packages:

  • package: dbt-labs/dbt_utils
    version: 1.1.1
  • package: dbt-labs/dbt_external_tables
    version: 0.8.5
  • package: fivetran/qualtrics
    version: [">=0.1.0", "<0.2.0"]

What database are you using dbt with?

bigquery

dbt Version

dbt=1.7.2

Additional Context

I think the resolution is to rename the column status -> response_status

Are you willing to open a PR to help address this issue?

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.
@davejroth davejroth added the bug Something isn't working label Dec 22, 2023
@fivetran-jamie
Copy link
Contributor

Hey there! So looking at the error message, i think this is related to the length of this doc description and the fact that you're persisting the docs. According to these BigQuery docs status should be okay to use as a field name, but BQ doesn't like the length of the column documentation

I think the most appropriate fix here would be to shorten the field's description to just be the link to the distribution status's Qualtrics API docs instead of listing them all out.

we'd be happy to prioritize reviewing a PR if you're open to creating one, otherwise i'd advise setting persist_docs to false for the time being. I think you could potentially just turn off persist_docs for this specific model by scoping the configuration to something like

models:
  +persist_docs:
    relation: true
    columns: true
  qualtrics_source:
    stg_qualtrics__distribution_contact:
      +persist_docs:
        relation: true
        columns: false

@fivetran-joemarkiewicz fivetran-joemarkiewicz added priority:p3 Affects many users; can wait status:accepted Scoped and accepted into queue type:bug Something is broken or incorrect update_type:documentation Primary focus requires documentation updates and removed bug Something isn't working labels Dec 27, 2023
@fivetran-catfritz fivetran-catfritz self-assigned this Jan 2, 2024
@fivetran-catfritz fivetran-catfritz added status:in_progress Currently being worked on and removed status:accepted Scoped and accepted into queue labels Jan 2, 2024
@fivetran-catfritz
Copy link
Contributor

Hi @davejroth I was able to reproduce the error on my end, and was also able to resolve it by making the changes @fivetran-jamie suggested previously. It would be helpful if you could verify this works for your case, so I have created a test branch that should enable you to run the package normally, without having to add passthrough vars or disabling persist_docs.

To install it, use the below snipped in your packages.yml in place of the current qualtrics lines.

packages:
  - git: https://github.com/fivetran/dbt_qualtrics.git
    revision: bug/persist-docs
    warn-unpinned: false

If you are able to test it out, please let me know how it works. Thanks!

@fivetran-catfritz fivetran-catfritz mentioned this issue Jan 3, 2024
7 tasks
@davejroth
Copy link
Author

davejroth commented Jan 4, 2024 via email

@fivetran-catfritz
Copy link
Contributor

Hi @davejroth thanks! I actually am going to go ahead and release this since I will be out of the office next week, but if it is not working for you after I release it, please let us know in this issue!

@fivetran-catfritz fivetran-catfritz linked a pull request Jan 4, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error:forced priority:p3 Affects many users; can wait status:in_progress Currently being worked on type:bug Something is broken or incorrect update_type:documentation Primary focus requires documentation updates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants