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

gcp_bigquery_table module: usage of nested schemas do not work #637

Open
danisana opened this issue Jul 12, 2024 · 0 comments
Open

gcp_bigquery_table module: usage of nested schemas do not work #637

danisana opened this issue Jul 12, 2024 · 0 comments

Comments

@danisana
Copy link

SUMMARY

I'm trying to create a table with a nested schema, using gcp_bigquery_table module
The json schema looks like this (as per Google Api format):

{
 "schema": {
  "fields": [
   {
    "name": "page_event",
    "mode": "REPEATED",
    "type": "RECORD",
    "fields": [
     {
      "name": "id",
      "type": "STRING"
     },
     {
      "name": "description",
      "type": "STRING"
     }
    ]
   }
  ]
 }
}

In the above example, inner fields element requires a list of dictionaries, while in ansible google.cloud collection it requires a list of strings:
image

I can't figure out how to let the above example work in ansible, as I don't understand if this is a missing feature or if I am missing something. In the second case, will it be possible to have an example on how to fill the inner schema using gcp_bigquery_table module?

ISSUE TYPE
  • Bug Report
COMPONENT NAME

gcp_bigquery_table

ANSIBLE VERSION
ansible [core 2.17.1]
  config file = None
  configured module search path = ['/home/dsana/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/dsana/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/dsana/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/dsana/.local/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION
ansible-galaxy collection list google.cloud
Collection   Version
------------ -------
google.cloud 1.3.0

CONFIGURATION
CONFIG_FILE() = None
STEPS TO REPRODUCE

Create a sample playbook that creates a table, schema structure it as follows:

        schema:
          fields:                  
            - name: page_event
              type: RECORD
              mode: REPEATED
              fields:
                - name: id
                  type: STRING
                - name: value
                  type: STRING
EXPECTED RESULTS

Table is created

ACTUAL RESULTS

Table is not created

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