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

Add location property to BigQuery data source settings #2513

Merged
merged 2 commits into from
Jul 31, 2018

Conversation

kyoshidajp
Copy link
Member

Feature

BigQuery began to support Tokyo region from April this year.

This PR adds a location property to BigQuery data source settings. And calls job query with it.

If it is not specified, the value is US (which is default BigQuery location).

Screenshot

bq_location

@kyoshidajp kyoshidajp force-pushed the support_location_in_bq_dataset branch from b86bb16 to bd1c5fa Compare May 4, 2018 07:06
@sekiyama58
Copy link
Contributor

Thanks kyoshidajp!
@arikfr Could you merge this one?

Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

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

Thanks, @kyoshidajp! Please see comments.

@@ -148,10 +155,15 @@ def _get_bigquery_service(self):
def _get_project_id(self):
return self.configuration["projectId"]

def _get_location(self):
location = self.configuration.get("location", "")
return "US" if location == "" else location
Copy link
Member

Choose a reason for hiding this comment

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

I think you can simplify this into:

def _get_location(self):
    return self.configuration.get("location", "US")

No?

@@ -110,6 +113,10 @@ def configuration_schema(cls):
"type": "boolean",
'title': "Use Standard SQL (Beta)",
},
'location': {
"type": "string",
'title': 'Processing Location (default: US)',
Copy link
Member

Choose a reason for hiding this comment

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

For default values we have the default property of the configuration item.

@kyoshidajp kyoshidajp force-pushed the support_location_in_bq_dataset branch from 889aeda to 5ca59a5 Compare July 25, 2018 23:10
@kyoshidajp
Copy link
Member Author

@arikfr Thanks. I fixed. Could you review again?

@arikfr arikfr merged commit c6f75dd into getredash:master Jul 31, 2018
@arikfr
Copy link
Member

arikfr commented Jul 31, 2018

Thanks!

@kyoshidajp kyoshidajp deleted the support_location_in_bq_dataset branch July 31, 2018 10:06
@arikfr arikfr mentioned this pull request Aug 6, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants