Skip to content

Creating a view using gcp_bigquery_table does not work #348

Description

@isaacm
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions