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

Merge 0.12.latest into master #1241

Merged
merged 116 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
738304f
dbt builtin profiler
cmcarthur Sep 20, 2018
3b0c9f8
merged dev/gb
cmcarthur Oct 29, 2018
42f817a
contracts and very basic tests for hub packages
Nov 1, 2018
e6fc0f6
make 2.7 exceptions have the same output as 3.x
Nov 1, 2018
3077eec
Avoid connecting to postgres on each run
Nov 2, 2018
7757c85
add some helpful exceptions about command running
Nov 5, 2018
59b6f78
Raise an exception on rc!=0 in run_cmd, raise more specific exception…
Nov 5, 2018
ec46606
Tests, fixup ci
Nov 5, 2018
e866caa
add support for cross-drive moves
Nov 5, 2018
531d7c6
use environment variables or per-run temp directories to assign the t…
Nov 5, 2018
412b165
fix issue where we incorrectly logged stack traces
Nov 6, 2018
3773843
in deps, when "git" is not in the path, link users to help docs
Nov 13, 2018
717d1ed
Merge pull request #1107 from fishtown-analytics/no-postgres-for-non-…
beckjake Nov 13, 2018
3515422
Merge branch 'dev/grace-kelly' into fix/dbt-deps-issues
Nov 13, 2018
7195f07
fix for local deps that depend on other local deps
drewbanin Nov 14, 2018
d35e549
Handle cross-drive windows permissions issues by undoing git's readon…
Nov 14, 2018
8840996
user feedback: log download directory in dbt deps
Nov 14, 2018
735ff88
Merge pull request #1110 from fishtown-analytics/fix/dbt-deps-issues
beckjake Nov 14, 2018
4b981ca
first cut at caching macro manifest
drewbanin Oct 31, 2018
3912028
bigquery: use delete_contents option in delete_dataset, remove unused…
cmcarthur Nov 15, 2018
0138228
Merge branch '0.12.latest' into dev/grace-kelly
drewbanin Nov 15, 2018
8aab340
Merge branch 'dev/grace-kelly' into profiler
Nov 19, 2018
3bdebba
Merge pull request #1123 from fishtown-analytics/fix/local-packages
drewbanin Nov 19, 2018
8eded70
PR feedback (move comment)
drewbanin Nov 19, 2018
399a685
add a special flag to make dbt use map instead of the pool
Nov 19, 2018
6dd04b1
set cache logger propagation during invocation time instead of at log…
Nov 16, 2018
7940b71
on dbt invocation, reset the adapters (to reset the cache)
Nov 16, 2018
d4c3fb8
fix schema cache casing bugs
Nov 16, 2018
cfd2d60
stop dropping renames...
Nov 16, 2018
eb50b83
Add integration tests with interesting model/case/quoting settings
Nov 16, 2018
7d3bf03
fix casing expectations in unit tests
Nov 16, 2018
e82361c
lowercase the cache's view of schema/identifier, fix drop
Nov 16, 2018
416173a
Merge pull request #1128 from fishtown-analytics/cache-macro-only-man…
drewbanin Nov 20, 2018
b5aab26
Merge pull request #1144 from fishtown-analytics/fix/run-repeatabilit…
beckjake Nov 20, 2018
0a66adf
Merge pull request #1142 from fishtown-analytics/feature/profiler-wit…
beckjake Nov 20, 2018
12433fd
Merge branch 'dev/grace-kelly' into profiler
Nov 20, 2018
029ef17
Merge pull request #1020 from fishtown-analytics/profiler
beckjake Nov 20, 2018
e543dc4
add pre_hook/post_hook kwargs to config, add tests
Nov 21, 2018
0307d78
PR feedback, tests around it
Nov 21, 2018
069bc3a
add do-syntax
Nov 21, 2018
f72e0a8
Merge pull request #1148 from fishtown-analytics/feature/jinja-do-sta…
beckjake Nov 23, 2018
71a2398
Merge branch 'dev/grace-kelly' into feature/hook-config-aliases
Nov 23, 2018
c4d6b2e
Delete dead code, move SourceConfig into the parser, allow multiple c…
Nov 23, 2018
1fd84ad
add unit tests
Nov 23, 2018
51252b0
Add a test for overwrite/append
Nov 23, 2018
dab2ff4
add a location field to the bigquery profile and pass it along to the…
Nov 23, 2018
b92d669
test that location gets passed along
Nov 23, 2018
d16ca86
Merge pull request #1151 from fishtown-analytics/feature/bq-profile-l…
beckjake Nov 26, 2018
b751ed6
Merge pull request #1146 from fishtown-analytics/feature/hook-config-…
beckjake Nov 26, 2018
5be8c7f
Merge pull request #1150 from fishtown-analytics/feature/config-mulip…
beckjake Nov 26, 2018
e7b1a09
Refactor the RunManager to build its runners as it iterates over the …
Nov 27, 2018
b6193be
add initial work on a graph-based priority queue
Nov 27, 2018
acddb3b
RunManager now operates on queues instead of lists
Nov 27, 2018
6e27476
Merge pull request #1105 from fishtown-analytics/fix/hub-packaging
beckjake Nov 28, 2018
8af3061
Merge pull request #1133 from fishtown-analytics/bigquery-smarter-del…
cmcarthur Nov 28, 2018
84ba7f5
fix many bugs, move RunBuilder back into the RunManager
Nov 27, 2018
5a06d57
use the manifest for node information and block/timeout arguments to …
Nov 28, 2018
4dc79f6
pr feedback, add many docstrings
Nov 29, 2018
3cf03f3
add "-m" shorthand for models
Nov 30, 2018
6025d3d
Merge pull request #1161 from fishtown-analytics/feature/m-is-for-models
beckjake Nov 30, 2018
9f9b861
handle cdecimal.Decimal during serialization as well as decimal.Decimal
Dec 3, 2018
3d205c3
fix analysis to only compile sql once like model nodes, fix test
Dec 3, 2018
adf05bd
get the default schema name generator from the root package
Nov 30, 2018
1744f21
Refactor nodes into objects, make generate_schema_name use its own co…
Dec 3, 2018
9d5cbf7
strip the schema when there is extra whitespace
Dec 3, 2018
aa9d43a
Merge pull request #1164 from fishtown-analytics/fix/analysis-parsing…
beckjake Dec 3, 2018
953ba9b
Merge pull request #1163 from fishtown-analytics/fix/cdecimal-json-en…
beckjake Dec 3, 2018
eb00b1a
Merge pull request #1166 from fishtown-analytics/fix/trim-schema-whit…
beckjake Dec 3, 2018
863dbd2
Merge branch 'dev/grace-kelly' into fix/use-root-generate-schema-name
Dec 3, 2018
8769118
drop the correct relation type on snowflake when building tables
Dec 4, 2018
0daca02
log about missing test ref targets at warning instead of debug level,…
Dec 4, 2018
3665e65
reorganize some things to make us better detect disabled vs missing n…
Dec 4, 2018
cbfa21c
PR feedback
Dec 4, 2018
d80b378
Merge pull request #1169 from fishtown-analytics/feature/log-warnings…
beckjake Dec 5, 2018
17f3f24
Merge pull request #1168 from fishtown-analytics/fix/snowflake-drops-…
beckjake Dec 5, 2018
5bdd1eb
Merge pull request #1159 from fishtown-analytics/fix/use-root-generat…
beckjake Dec 5, 2018
937219d
add connection_info method to credentials for dbt debug
Dec 4, 2018
3434ad9
Bypass project loading in init, we do it anyway
Dec 4, 2018
d4c2dfe
dbt debug
Dec 4, 2018
bb6b469
Merge pull request #1157 from fishtown-analytics/feature/graph-iteration
beckjake Dec 5, 2018
eef5024
Merge branch 'dev/grace-kelly' into feature/make-debug-great
Dec 5, 2018
6935a4a
pr feedback: add pretty colors
Dec 5, 2018
9938af1
pr feedback
Dec 5, 2018
80232ff
(fixes #744) deprecate sql_where and provide an alternative
drewbanin Nov 15, 2018
009eaa3
pep8
drewbanin Dec 5, 2018
0f1520c
re-add call to path_info
Dec 5, 2018
eb504ae
use pypi for the latest version instead of git
Dec 5, 2018
8ea9c68
PR feedback
Dec 5, 2018
9b8e8ff
more pr feedback
Dec 5, 2018
65729c4
Bump version: 0.12.1 → 0.12.2a1
cmcarthur Dec 5, 2018
963fb84
Merge pull request #1171 from fishtown-analytics/feature/make-debug-g…
beckjake Dec 5, 2018
2cd24cf
Merge pull request #1129 from fishtown-analytics/feature/better-incre…
drewbanin Dec 5, 2018
bec30ef
Merge pull request #1174 from fishtown-analytics/feature/latest-versi…
beckjake Dec 5, 2018
d2c7048
Bump version: 0.12.2a1 → 0.12.2rc1
cmcarthur Dec 7, 2018
808ed75
make tracking use the profile directory, and suppress errors
Dec 12, 2018
ebd6d3e
Update readme and cleanup repo
clrcrl Dec 13, 2018
f56ac54
Merge branch 'dev/grace-kelly' into cleanup-repo
clrcrl Dec 13, 2018
3deb295
Merge pull request #1147 from fishtown-analytics/cleanup-repo
clrcrl Dec 13, 2018
15c0470
Add ipdb to dev requirements so it shows up in test docker containers…
Dec 13, 2018
08913bf
Merge pull request #1188 from fishtown-analytics/ipdb-dev-requirement
beckjake Dec 13, 2018
5deb7e8
everything about tracking is hard
Dec 13, 2018
3cbf49c
Add m flag for tests
clrcrl Dec 13, 2018
afa9fc0
Merge pull request #1189 from fishtown-analytics/add-m-flag-for-tests
clrcrl Dec 14, 2018
e52475c
Merge pull request #1186 from fishtown-analytics/fix/tracking
beckjake Dec 14, 2018
ea401f6
Update CHANGELOG.md
drewbanin Dec 21, 2018
f90a5b1
(fixes #1201) Replace unicode characters with ascii strings
drewbanin Jan 2, 2019
769a886
Merge pull request #1206 from fishtown-analytics/fix/windows-unicode-…
drewbanin Jan 3, 2019
5826bc8
(fixes #1209) do not try to remove remote after dbt init
drewbanin Jan 4, 2019
f43d9b5
pr feedback
drewbanin Jan 4, 2019
3c25a9b
Merge pull request #1210 from fishtown-analytics/fix/dbt-init-command
drewbanin Jan 4, 2019
3e4523e
On errors inside the thread, set a `raise_next_tick` flag
Jan 7, 2019
7179d13
Merge pull request #1218 from fishtown-analytics/fix/lets-not-hang-on…
beckjake Jan 7, 2019
6d69ff0
Update CHANGELOG.md
drewbanin Jan 7, 2019
1da50ab
Merge pull request #1200 from fishtown-analytics/changelog/grace-kelly
drewbanin Jan 7, 2019
b5f5117
Merge pull request #1220 from fishtown-analytics/dev/grace-kelly
cmcarthur Jan 7, 2019
83c8381
Bump version: 0.12.2rc1 → 0.12.2
cmcarthur Jan 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.12.1
current_version = 0.12.2
parse = (?P<major>\d+)
\.(?P<minor>\d+)
\.(?P<patch>\d+)
Expand Down
54 changes: 13 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,83 @@
version: 2
jobs:
unit:
docker: &py36
- image: python:3.6
docker: &test_and_postgres
- image: fishtownjacob/test-container
- image: postgres
name: database
environment: &pgenv
POSTGRES_USER: "root"
POSTGRES_PASSWORD: "password"
POSTGRES_DB: "dbt"
steps:
- checkout
- run: apt-get update && apt-get install -y python-dev python3-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run: &setupdb
name: Setup postgres
command: bash test/setup_db.sh
environment:
PGHOST: 127.0.0.1
PGHOST: database
PGUSER: root
PGPASSWORD: password
PGDATABASE: postgres
- run: tox -e pep8,unit-py27,unit-py36
integration-postgres-py36:
docker: *py36
docker: *test_and_postgres
steps:
- checkout
- run: apt-get update && apt-get install -y python3-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run: *setupdb
- run:
name: Run tests
command: tox -e integration-postgres-py36
integration-snowflake-py36:
docker: *py36
docker: &test_only
- image: fishtownjacob/test-container
steps:
- checkout
- run: apt-get update && apt-get install -y python3-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run:
name: Run tests
command: tox -e integration-snowflake-py36
no_output_timeout: 1h
integration-redshift-py36:
docker: *py36
docker: *test_only
steps:
- checkout
- run: apt-get update && apt-get install -y python3-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run:
name: Run tests
command: tox -e integration-redshift-py36
integration-bigquery-py36:
docker: *py36
docker: *test_only
steps:
- checkout
- run: apt-get update && apt-get install -y python3-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run:
name: Run tests
command: tox -e integration-bigquery-py36
integration-postgres-py27:
docker: &py27
- image: python:2.7
- image: postgres
environment: *pgenv
docker: *test_and_postgres
steps:
- checkout
- run: apt-get update && apt-get install -y python-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run: *setupdb
- run:
name: Run tests
command: tox -e integration-postgres-py27
integration-snowflake-py27:
docker: *py27
docker: *test_only
steps:
- checkout
- run: apt-get update && apt-get install -y python-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run:
name: Run tests
command: tox -e integration-snowflake-py27
no_output_timeout: 1h
integration-redshift-py27:
docker: *py27
docker: *test_only
steps:
- checkout
- run: apt-get update && apt-get install -y python-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run:
name: Run tests
command: tox -e integration-redshift-py27
integration-bigquery-py27:
docker: *py27
docker: *test_only
steps:
- checkout
- run: apt-get update && apt-get install -y python-dev postgresql
- run: echo 127.0.0.1 database | tee -a /etc/hosts
- run: pip install virtualenvwrapper tox
- run:
name: Run tests
command: tox -e integration-bigquery-py27
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
## dbt 0.12.2 - Grace Kelly (January 8, 2019)

### Overview

This release reduces the runtime of dbt projects by improving dbt's approach to model running. Additionally, a number of workflow improvements have been added.

### Deprecations
- Deprecate `sql_where` ([#744](https://github.com/fishtown-analytics/dbt/issues/744)) ([docs](https://docs.getdbt.com/v0.12/docs/configuring-incremental-models))

### Features
- More intelligently order and execute nodes in the graph. This _significantly_ speeds up the runtime of most dbt projects ([#813](https://github.com/fishtown-analytics/dbt/issues/813))
- Add `-m` flag as an alias for `--models` ([#1160](https://github.com/fishtown-analytics/dbt/issues/1160))
- Add `post_hook` and `pre_hook` as aliases for `post-hook` and `pre-hook`, respectively ([#1124](https://github.com/fishtown-analytics/dbt/issues/1124)) ([docs](https://docs.getdbt.com/v0.12/docs/using-hooks))
- Better handling of git errors in `dbt deps` + full support for Windows ([#994](https://github.com/fishtown-analytics/dbt/issues/994), [#778](https://github.com/fishtown-analytics/dbt/issues/778), [#895](https://github.com/fishtown-analytics/dbt/issues/895))
- Add support for specifying a `location` in BigQuery datasets ([#969](https://github.com/fishtown-analytics/dbt/issues/969)) ([docs](https://docs.getdbt.com/v0.12/docs/supported-databases#section-dataset-locations))
- Add support for Jinja expressions using the `{% do ... %}` block ([#1113](https://github.com/fishtown-analytics/dbt/issues/1113))
- The `dbt debug` command is actually useful now ([#1061](https://github.com/fishtown-analytics/dbt/issues/1061))
- The `config` function can now be called multiple times in a model ([#558](https://github.com/fishtown-analytics/dbt/issues/558))
- Source the latest version of dbt from PyPi instead of GitHub ([#1122](https://github.com/fishtown-analytics/dbt/issues/1122))
- Add a peformance profiling mechnanism to dbt ([#1001](https://github.com/fishtown-analytics/dbt/issues/1001))
- Add caching for dbt's macros-only manifest to speedup parsing ([#1098](https://github.com/fishtown-analytics/dbt/issues/1098))

### Fixes
- Fix for custom schemas used alongside the `generate_schema_name` macro ([#801](https://github.com/fishtown-analytics/dbt/issues/801))
- Fix for silent failure of tests that reference nonexistent models ([#968](https://github.com/fishtown-analytics/dbt/issues/968))
- Fix for `generate_schema_name` macros that return whitespace-padded schema names ([#1074](https://github.com/fishtown-analytics/dbt/issues/1074))
- Fix for incorrect relation type for backup tables on Snowflake ([#1103](https://github.com/fishtown-analytics/dbt/issues/1103))
- Fix for incorrectly cased values in the relation cache ([#1140](https://github.com/fishtown-analytics/dbt/issues/1140))
- Fix for JSON decoding error on Python2 installed with Anaconda ([#1155](https://github.com/fishtown-analytics/dbt/issues/1155))
- Fix for unhandled exceptions that occur in anonymous event tracking ([#1180](https://github.com/fishtown-analytics/dbt/issues/1180))
- Fix for analysis files that contain `raw` tags ([#1152](https://github.com/fishtown-analytics/dbt/issues/1152))
- Fix for packages which reference the [hubsite](hub.getdbt.com) ([#1095](https://github.com/fishtown-analytics/dbt/issues/1095))


## dbt 0.12.1 - (November 15, 2018)

### Overview
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM python:3.6

RUN apt-get update

RUN apt-get install -y python-pip netcat
RUN apt-get install -y python-dev python3-dev
# do these on one line so changes trigger apt-get update
RUN apt-get update && \
apt-get install -y python-pip netcat python-dev python3-dev postgresql

RUN pip install pip --upgrade
RUN pip install virtualenv
RUN pip install virtualenvwrapper
RUN pip install tox

RUN useradd -mU dbt_test_user
USER dbt_test_user

WORKDIR /usr/src/app
RUN cd /usr/src/app
71 changes: 40 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,58 @@
# dbt
<p align="center">
<img src="/etc/dbt-horizontal.png" alt="dbt logo"/>
</p>
<p align="center">
<a href="https://codeclimate.com/github/fishtown-analytics/dbt">
<img src="https://codeclimate.com/github/fishtown-analytics/dbt/badges/gpa.svg" alt="Code Climate"/>
</a>
<a href="https://circleci.com/gh/fishtown-analytics/dbt/tree/master">
<img src="https://circleci.com/gh/fishtown-analytics/dbt/tree/master.svg?style=svg" alt="CircleCI" />
</a>
<a href="https://ci.appveyor.com/project/DrewBanin/dbt/branch/development">
<img src="https://ci.appveyor.com/api/projects/status/v01rwd3q91jnwp9m/branch/development?svg=true" alt="AppVeyor" />
</a>
<a href="https://slack.getdbt.com">
<img src="https://slack.getdbt.com/badge.svg" alt="Slack" />
</a>
</p>

dbt (data build tool) helps analysts write reliable, modular code using a workflow that closely mirrors software development.
**[dbt](https://www.getdbt.com/)** (data build tool) enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.

A dbt project primarily consists of "models". These models are SQL `select` statements that filter, aggregate, and otherwise transform data to facilitate analytics. Analysts use dbt to [aggregate pageviews into sessions](https://github.com/fishtown-analytics/snowplow), calculate [ad spend ROI](https://github.com/fishtown-analytics/facebook-ads), or report on [email campaign performance](https://github.com/fishtown-analytics/mailchimp).
dbt is the T in ELT. Organize, cleanse, denormalize, filter, rename, and pre-aggregate the raw data in your warehouse so that it's ready for analysis.

These models frequently build on top of one another. Fortunately, dbt makes it easy to [manage relationships](https://docs.getdbt.com/reference#ref) between models, [test](https://docs.getdbt.com/docs/testing) your assumptions, and [visualize](https://graph.sinterdata.com/) your projects.
![dbt architecture](/etc/dbt-arch.png?raw=true)

Still reading? Check out the [docs](https://docs.getdbt.com/docs/overview) for more information.
dbt can be used to [aggregate pageviews into sessions](https://github.com/fishtown-analytics/snowplow), calculate [ad spend ROI](https://github.com/fishtown-analytics/facebook-ads), or report on [email campaign performance](https://github.com/fishtown-analytics/mailchimp).

![dbt dag](/etc/dag.png?raw=true)
## Understanding dbt

---
### Getting Started
Analysts using dbt can transform their data by simply writing select statements, while dbt handles turning these statements into tables and views in a data warehouse.

- [What is dbt]?
- Read the [dbt viewpoint]
- [Installation]
- Join the [chat][slack-url] on Slack for live questions and support.
These select statements, or "models", form a dbt project. Models frequently build on top of one another – dbt makes it easy to [manage relationships](https://docs.getdbt.com/reference#ref) between models, and [visualize these relationships](https://docs.getdbt.com/docs/documentation), as well as assure the quality of your transformations through [testing](https://docs.getdbt.com/docs/testing).

---
### The dbt ecosystem
- Visualize your dbt graph [here](https://graph.sinterdata.com/)
- Run your dbt projects on a schedule [here](http://sinterdata.com/)
![dbt dag](/etc/dbt-dag.png?raw=true)

---
## Getting started

[![Code Climate](https://codeclimate.com/github/fishtown-analytics/dbt/badges/gpa.svg)](https://codeclimate.com/github/fishtown-analytics/dbt) [![Slack](https://slack.getdbt.com/badge.svg)](https://slack.getdbt.com)
- [Install dbt](https://docs.getdbt.com/docs/installation)
- Read the [documentation](https://docs.getdbt.com/).
- Productionize your dbt project with [Sinter](https://www.sinterdata.com)

### Testing
## Find out more

| service | development | master |
| --- | --- | --- |
| CircleCI| [![CircleCI](https://circleci.com/gh/fishtown-analytics/dbt/tree/development.svg?style=svg)](https://circleci.com/gh/fishtown-analytics/dbt/tree/development) | [![CircleCI](https://circleci.com/gh/fishtown-analytics/dbt/tree/master.svg?style=svg)](https://circleci.com/gh/fishtown-analytics/dbt/tree/master) |
| AppVeyor | [![AppVeyor](https://ci.appveyor.com/api/projects/status/v01rwd3q91jnwp9m/branch/development?svg=true)](https://ci.appveyor.com/project/DrewBanin/dbt/branch/development) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/v01rwd3q91jnwp9m/branch/master?svg=true)](https://ci.appveyor.com/project/DrewBanin/dbt/branch/master) |
- Check out the [Introduction to dbt](https://dbt.readme.io/docs/introduction).
- Read the [dbt Viewpoint](https://dbt.readme.io/docs/viewpoint).

[Coverage](https://circleci.com/api/v1/project/fishtown-analytics/dbt/latest/artifacts/0/$CIRCLE_ARTIFACTS/htmlcov/index.html?branch=development)
## Join thousands of analysts in the dbt community

## Code of Conduct
- Join the [chat](http://slack.getdbt.com/) on Slack.
- Find community posts on [dbt Discourse](https://discourse.getdbt.com).

Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [PyPA Code of Conduct].
## Reporting bugs and contributing code

- Want to report a bug or request a feature? Let us know on [Slack](http://slack.getdbt.com/), or open [an issue](https://github.com/fishtown-analytics/dbt/issues/new).
- Want to help us build dbt? Check out the [Contributing Getting Started Guide](/CONTRIBUTING.md)

## Code of Conduct

[PyPA Code of Conduct]: https://www.pypa.io/en/latest/code-of-conduct/
[slack-url]: https://slack.getdbt.com/
[Installation]: https://docs.getdbt.com/docs/installation
[What is dbt]: https://docs.getdbt.com/docs/overview
[dbt viewpoint]: https://docs.getdbt.com/docs/viewpoint
Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/).
15 changes: 4 additions & 11 deletions dbt/adapters/bigquery/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ def get_bigquery_credentials(cls, profile_credentials):
def get_bigquery_client(cls, profile_credentials):
project_name = profile_credentials.project
creds = cls.get_bigquery_credentials(profile_credentials)

return google.cloud.bigquery.Client(project_name, creds)
location = getattr(profile_credentials, 'location', None)
return google.cloud.bigquery.Client(project_name, creds,
location=location)

@classmethod
def open_connection(cls, connection):
Expand Down Expand Up @@ -447,13 +448,6 @@ def create_schema(self, schema, model_name=None):
with self.exception_handler('create dataset', model_name):
client.create_dataset(dataset)

def drop_tables_in_schema(self, dataset):
conn = self.get_connection()
client = conn.handle

for table in client.list_tables(dataset):
client.delete_table(table.reference)

def drop_schema(self, schema, model_name=None):
logger.debug('Dropping schema "%s".', schema)

Expand All @@ -465,8 +459,7 @@ def drop_schema(self, schema, model_name=None):

dataset = self.get_dataset(schema, model_name)
with self.exception_handler('drop dataset', model_name):
self.drop_tables_in_schema(dataset)
client.delete_dataset(dataset)
client.delete_dataset(dataset, delete_contents=True)

def get_existing_schemas(self, model_name=None):
conn = self.get_connection(model_name)
Expand Down
Loading