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

Creating a view using gcp_bigquery_table does not work #348

Closed
isaacm opened this issue Dec 5, 2020 · 2 comments
Closed

Creating a view using gcp_bigquery_table does not work #348

isaacm opened this issue Dec 5, 2020 · 2 comments

Comments

@isaacm
Copy link

isaacm commented Dec 5, 2020

SUMMARY

How do I create a view using gcp_bigquery_table module?

ISSUE TYPE
  • Question
COMPONENT NAME

gcp_bigquery_table

ANSIBLE VERSION
ansible 2.10.3
  config file = /Users/<username>/.ansible.cfg
  configured module search path = [u'/Users/<username>/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/<username>/.virtualenvs/porcelainweb/lib/python2.7/site-packages/ansible
  executable location = /Users/<usernamae>/.virtualenvs/porcelainweb/bin/ansible
  python version = 2.7.16 (default, Nov 26 2019, 20:10:25) [GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.12)]
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE
    - name: "Create views in dataset website_prod"
      google.cloud.gcp_bigquery_table:
        name: my_view
        dataset: my_dataset
        table_reference:
          dataset_id: my_dataset
          project_id: my_project
          table_id: my_view
        project: my_project
        view:
          use_legacy_sql: false
          user_defined_function_resources:
             - inline_code: "<truncated>"
        auth_kind: "serviceaccount"
        service_account_file: "{{ service_account_file }}"
        state: present
EXPECTED RESULTS

A view should be created in google cloud platform

ACTUAL RESULTS
"msg": "GCP returned error: {u'error': {u'status': u'INVALID_ARGUMENT', u'message': u'Query is required for views', u'code': 400, u'errors': [{u'reason': u'invalid', u'message': u'Query is required for views', u'domain': u'global'}]}}"

How do I pass the missing "Query" portion in ansible? Is there any additional documentation on creating a big query view?

@isaacm isaacm closed this as completed Mar 14, 2021
@jinnjwu
Copy link

jinnjwu commented Jan 10, 2024

I hit this issue too. Have you solved it, what is resulotioin

@isaacm
Copy link
Author

isaacm commented Jan 10, 2024

Our resolution involved creating a custom ansible module to handle our use case. Something similar to #479

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

2 participants