Skip to content

Commit

Permalink
config->configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
necnec committed Jan 3, 2017
1 parent 82f4409 commit 3a238a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4656,13 +4656,13 @@ For more information about query configuration parameters see

.. code-block:: python
config = {
configuration = {
'query': {
"useQueryCache": False
}
}
data_frame = pd.read_gbq('SELECT * FROM test_dataset.test_table',
config=config, projectid)
configuration=configuration, projectid)
.. note::
Expand Down
6 changes: 3 additions & 3 deletions pandas/io/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def run_query(self, query, **kwargs):
# 'preserveNulls', destinationTable, useQueryCache
}
}
config = kwargs.get('config')
config = kwargs.get('configuration')
if config is not None:
if len(config) != 1:
raise ValueError("Only one job type must be specified, but "
Expand Down Expand Up @@ -701,10 +701,10 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
.. versionadded:: 0.19.0
**kwargs : Arbitrary keyword arguments
config (dict): query config parameters for job processing.
configuration (dict): query config parameters for job processing.
For example:
config = {'query': {'useQueryCache': False}}
configuration = {'query': {'useQueryCache': False}}
For more information see `BigQuery SQL Reference
<https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query>`
Expand Down
8 changes: 4 additions & 4 deletions pandas/io/tests/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def test_query_with_parameters(self):
# the correct query parameters via the 'config' option
df = gbq.read_gbq(sql_statement, project_id=_get_project_id(),
private_key=_get_private_key_path(),
config=config)
configuration=config)
tm.assert_frame_equal(df, DataFrame({'VALID_RESULT': [3]}))

def test_query_inside_configuration(self):
Expand All @@ -766,11 +766,11 @@ def test_query_inside_configuration(self):
with tm.assertRaises(ValueError):
gbq.read_gbq(query_no_use, project_id=_get_project_id(),
private_key=_get_private_key_path(),
config=config)
configuration=config)

df = gbq.read_gbq(None, project_id=_get_project_id(),
private_key=_get_private_key_path(),
config=config)
configuration=config)
tm.assert_frame_equal(df, DataFrame({'VALID_STRING': ['PI']}))

def test_configuration_without_query(self):
Expand All @@ -794,7 +794,7 @@ def test_configuration_without_query(self):
with tm.assertRaises(ValueError):
gbq.read_gbq(sql_statement, project_id=_get_project_id(),
private_key=_get_private_key_path(),
config=config)
configuration=config)


class TestToGBQIntegration(tm.TestCase):
Expand Down

0 comments on commit 3a238a5

Please sign in to comment.