Skip to content

Python bigquery export script does not export with correct schema when compared with gcloud export #11092

@sureshs123

Description

@sureshs123

I have tried to export the asset details to biquery for writing queries to fetch certain data, Initially i tried with gcloud sdk and it exported the required data in the perfect schema .
when i try to do the same with the python code to export assets to biquery using this script https://github.com/googleapis/python-asset/blob/main/samples/snippets/quickstart_exportassets.py it seems to be exporting the data in incorrect schema which i am not able to query

Steps to reproduce

  1. Run https://github.com/googleapis/python-asset/blob/main/samples/snippets/quickstart_exportassets.py script to export serviceaccountKey asset type to bigquery.
  2. Perform the same export using gcloud asset export command and compare with that of the python script .
  3. Please find the attached screenshots of the schema

When exported using gcloud sdk this is the schema obtained which is the expected schema.

image

When exported using client library this is the schema obtained which is the incorrect schema.

image

Am I missing any additional config in the python script? I am trying to export serviceAccountKey resource to bigquery. Do let me know if any additional details are required.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: cloudassetIssues related to the Cloud Asset Inventory API.samplesIssues that are directly related to samples.type: docsImprovement to the documentation for an API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions