You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery-sqlalchemy/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
Fixes#90 🦕
``project`` in ``bigquery://project`` is used to instantiate BigQuery client with the specific project ID. To infer project from the environment, use ``bigquery://`` – without ``project``
33
109
34
110
Authentication
35
-
______________
111
+
^^^^^^^^^^^^^^
36
112
37
113
Follow the `Google Cloud library guide <https://google-cloud-python.readthedocs.io/en/latest/core/auth.html>`_ for authentication. Alternatively, you can provide the path to a service account JSON file in ``create_engine()``:
By default, ``arraysize`` is set to ``5000``. ``arraysize`` is used to set the batch size for fetching results. To change it, pass ``arraysize`` to ``create_engine()``:
70
146
@@ -74,7 +150,7 @@ By default, ``arraysize`` is set to ``5000``. ``arraysize`` is used to set the b
74
150
75
151
76
152
Adding a Default Dataset
77
-
________________________
153
+
^^^^^^^^^^^^^^^^^^^^^^^^
78
154
79
155
If you want to have the ``Client`` use a default dataset, specify it as the "database" portion of the connection string.
80
156
@@ -100,7 +176,7 @@ Note that specifying a default dataset doesn't restrict execution of queries to
100
176
101
177
102
178
Connection String Parameters
103
-
____________________________
179
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
180
105
181
There are many situations where you can't call ``create_engine`` directly, such as when using tools like `Flask SQLAlchemy <http://flask-sqlalchemy.pocoo.org/2.3/>`_. For situations like these, or for situations where you want the ``Client`` to have a `default_query_job_config <https://googlecloudplatform.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.client.Client.html#google.cloud.bigquery.client.Client>`_, you can pass many arguments in the query of the connection string.
106
182
@@ -132,7 +208,7 @@ Here are examples of all the supported arguments. Any not present are either for
132
208
133
209
134
210
Creating tables
135
-
_______________
211
+
^^^^^^^^^^^^^^^
136
212
137
213
To add metadata to a table:
138
214
@@ -145,28 +221,3 @@ To add metadata to a column:
145
221
.. code-block:: python
146
222
147
223
Column('mycolumn', doc='my column description')
148
-
149
-
150
-
Requirements
151
-
============
152
-
153
-
Install using
154
-
155
-
- ``pip install pybigquery``
156
-
157
-
158
-
Testing
159
-
============
160
-
161
-
Load sample tables::
162
-
163
-
./scripts/load_test_data.sh
164
-
165
-
This will create a dataset ``test_pybigquery`` with tables named ``sample_one_row`` and ``sample``.
0 commit comments