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

Edge case for object properties with empty schemas #86

Merged
merged 1 commit into from
May 23, 2024

Conversation

rubenvereecken
Copy link
Contributor

I ran into issues with properties that had the following type

{'items': {'type': 'object'}, 'type': ['null', 'array']}

because BQ was expecting a schema for the objects, but target-bigquery was generating an empty schema RECORD type.

This PR changes that to a JSON type if there's nothing to base a schema on, in line with the general assumption that JSON is a good fallback.

Should break nothing, as hitting this edge case produces errors without this PR.

@buu-nguyen
Copy link
Contributor

LGTM
I faced the same issue. After merging this into my fork, it works perfectly.

@z3z1ma
Copy link
Owner

z3z1ma commented May 23, 2024

LGTM, thanks for this!

@z3z1ma z3z1ma merged commit f48f1d4 into z3z1ma:main May 23, 2024
@rubenvereecken rubenvereecken deleted the feat/json-properties branch May 24, 2024 08:54
@rubenvereecken rubenvereecken restored the feat/json-properties branch May 24, 2024 08:54
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.

3 participants