-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Allow users to specify whether gbq should use standard SQL #13850
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
Conversation
4f9fbf2
to
5e17ee9
Compare
Current coverage is 85.27% (diff: 0.00%)@@ master #13850 diff @@
==========================================
Files 139 139
Lines 50011 50014 +3
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 42650 42650
- Misses 7361 7364 +3
Partials 0 0
|
@@ -145,13 +145,14 @@ class GbqConnector(object): | |||
scope = 'https://www.googleapis.com/auth/bigquery' | |||
|
|||
def __init__(self, project_id, reauth=False, verbose=False, | |||
private_key=None): | |||
private_key=None, standard_sql=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
call this dialect
5e17ee9
to
fb9a6be
Compare
All gbq tests passed locally with my latest commit
|
@@ -4482,6 +4482,12 @@ destination DataFrame as well as a preferred column order as follows: | |||
|
|||
You can toggle the verbose output via the ``verbose`` flag which defaults to ``True``. | |||
|
|||
.. note:: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh j meant make this take a string
maybe standard (or legacy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fb9a6be
to
1641f07
Compare
All gbq tests passed locally.
|
1641f07
to
efd6d4b
Compare
@jreback |
@@ -557,6 +557,21 @@ def test_zero_rows(self): | |||
expected_result = DataFrame(page_array, columns=['title', 'id']) | |||
self.assert_frame_equal(df, expected_result) | |||
|
|||
def test_standard_sql(self): | |||
standard_sql = "SELECT DISTINCT id FROM " \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test where you validate legacy
? (e.g. that it must be standard/legacy in lowercase)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
efd6d4b
to
802dd64
Compare
All gbq tests pass with my latest commit.
|
@@ -612,8 +620,12 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None, | |||
if not project_id: | |||
raise TypeError("Missing required parameter: project_id") | |||
|
|||
if dialect not in ('legacy', 'standard'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you add a test that exercises this exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
802dd64
to
e1fbb07
Compare
All gbq tests pass locally with my latest commit
|
@jreback |
thanks @parthea still would like to have some testing actually on travis.....any update / luck with this? (e.g. we would need a test account with google / credentials which we can embed in travis via secure key) |
I have sent an email to Google to see if we can get a test account. I'll post here if I get an update. In the meantime, another (quicker) option would be to create a new Google account through the normal channels which can be used primarily for pandas. There will most likely be a cost associated (Should be < $1 per month, but there is a $200 free trial so costs are not incurred during the first 2 months). Would that work? |
git diff upstream/master | flake8 --diff
All gbq tests passed locally