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

fix(export/bigquery): fixes schema issue with untyped objects in data contract #517

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ricardolpd
Copy link

## Description:

Data models with no properties (untyped maps) currently create empty records which in turn create invalid bq schemas:

   someJson:
        type: object
        required: false

generate the following

{
        "name": "someJson:",
        "type": "RECORD",
        "mode": "NULLABLE",
        "description": null,
        "fields": []
      },

which causes the following error:

Error: googleapi: Error 400: Field rootObject.someJson is type RECORD but has no schema, invalid
│ 

But it should generate a JSON type instead:

{
    "name": "someJson",
     "type": "JSON",
     "mode": "NULLABLE",
     "description": null
}

This pr does a small fix to allow these types which can happen when having generic JSON maps

  • Tests pass
  • ruff format
  • README.md updated (if relevant)
  •  CHANGELOG.md entry added

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

Successfully merging this pull request may close these issues.

1 participant