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 bigquery catalog queries with nonexistent schemas (#1984) #2005

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

beckjake
Copy link
Contributor

Fixes #1984

Fix bigquery catalog queries when schemas don't exist, by filtering them out. There's a minor hack in the catalog macro to stub out the query in the event that there are no valid information schemas to query.

@beckjake beckjake requested a review from drewbanin December 13, 2019 16:19
@cla-bot cla-bot bot added the cla:yes label Dec 13, 2019
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment here, but otherwise this looks great!

{% for information_schema in information_schemas %}
{%- if (information_schemas | length) == 0 -%}
{# Hopefully nothing cares about the columns we return when there are no rows #}
{%- set query = "select 1 as id limit 0" -%}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we return(none) here and make the get_catalog method error with a sensible message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it really error instead of the catalog just being empty? As it is this works, it just generates an empty catalog.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, ok, that's great. Ship this as-is :D

@beckjake beckjake merged commit 02c2926 into dev/0.15.1 Dec 13, 2019
@beckjake beckjake deleted the fix/bigquery-catalog-info-schema-queries branch December 13, 2019 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue generating docs on BigQuery
2 participants