-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature/gcp #841
Merged
Merged
Feature/gcp #841
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
14637fe
Add a GCS store backend and unit test
2ef230d
Add SQLAlchemy backend support for BiqQuery via pybigquery
600ef3d
Add GCP deps to dev requirements file
4ca82a9
Merge pull request #1 from great-expectations/develop
scarrucciu 88ca8f8
Merge branch 'develop' into feature/gcp, resolve 3 conflicts in data_…
dbc204b
Update docs to reflect gcs in addition to s3
c026cef
Add integration doc for bigquery
e50c11e
Merge develop branch
54f0fe9
Adjust GCS store _set and _get
8a4ef04
Updated docs, adjusted bigquery_temp_table kwarg handling, alert user…
3ae159f
remove prompt-toolkit from requirements-dev
e68a246
Merge branch 'develop' into feature/gcp
jcampbell fe3e0de
Update great_expectations/dataset/sqlalchemy_dataset.py
williamjr 8c81d4a
Update requirements-dev.txt
williamjr 636a37c
Update requirements-dev.txt
williamjr 94b456d
Adjust BQ docs; check for bigquery dialect in warning
8bf50a0
Merge branch 'develop' into feature/gcp
jcampbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.. _BigQuery: | ||
|
||
############## | ||
BigQuery | ||
############## | ||
|
||
To add a BigQuery datasource do this: | ||
|
||
1. Run ``great_expectations add-datasource`` | ||
2. Choose the *SQL* option from the menu. | ||
3. When asked which sqlalchemy driver to use enter ``bigquery``. | ||
4. Consult the `PyBigQuery <https://github.com/mxmzdlv/pybigquery`_ docs | ||
for help building a connection string for your BigQuery cluster. It will look | ||
something like this: | ||
|
||
.. code-block:: python | ||
|
||
"bigquery://project-name" | ||
|
||
|
||
5. Paste in this connection string and finish out the cli prompts. | ||
6. Should you need to modify your connection string you can manually edit the | ||
``great_expectations/uncommitted/config_variables.yml`` file. | ||
|
||
Custom Queries with SQL datasource | ||
================================== | ||
|
||
While other backends use temporary tables to generate batches of data from | ||
custom queries, BigQuery does not support ephemeral temporary tables. As a | ||
work-around, GE will create or replace a *permanent table* when the user supplies | ||
a custom query. | ||
|
||
Users can specify a table via a Batch Kwarg called ``bigquery_temp_table``: | ||
|
||
.. code-block:: python | ||
|
||
batch_kwargs = { | ||
"query": "SELECT * FROM `my-project.my_dataset.my_table`", | ||
"bigquery_temp_table": "my_other_dataset.temp_table" | ||
} | ||
|
||
Otherwise, default behavior depends on how the pybigquery engine is configured: | ||
|
||
If a default BigQuery dataset is defined in the connection string | ||
(for example, ``bigquery://project-name/dataset-name``), and no ``bigquery_temp_table`` | ||
Batch Kwarg is supplied, then GE will create a permanent table with a random | ||
UUID that location | ||
(e.g. ``project-name.dataset-name.ge_tmp_1a1b6511_03e6_4e18_a1b2_d85f9e9045c3``). | ||
|
||
If a default BigQuery dataset is not defined in the connection string | ||
(for example, ``bigquery://project-name``) and no ``bigquery_temp_table`` Batch Kwawrg | ||
is supplied, then custom queries will fail. | ||
|
||
|
||
Additional Notes | ||
================= | ||
|
||
Follow the `Google Cloud library guide <https://googleapis.dev/python/google-api-core/latest/auth.html>`_ | ||
for authentication. | ||
|
||
Install the pybigquery package for the BigQuery sqlalchemy dialect (``pip install pybigquery``) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
note to self: harmonize this with the change for platform independent paths in #848