-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
get_columns_in_table parity #709
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8a2f792
support numeric types, slight refactor (fixes: https://github.com/fis…
drewbanin 4b0737b
Merge branch 'development' into get-columns-in-table-parity
drewbanin af9b3bb
working on bigquery
drewbanin 46a8df2
Support cross-database column lookups
drewbanin 3ababb9
pep8 fixes, plus fix syntax error
drewbanin 095cfa6
test for bq get_columns_in_table
drewbanin c9ff712
pep8
drewbanin 963e392
fix test, catch 404 for get_columns_in_table
drewbanin b38ed81
fix bq tests
drewbanin 4512ade
Merge branch 'development' into get-columns-in-table-parity
drewbanin 10c4198
add tests, unnest columns with macro
drewbanin 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
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
12 changes: 12 additions & 0 deletions
12
test/integration/022_bigquery_test/adapter-models/adapters.sql
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,12 @@ | ||
|
||
|
||
{% set source = ref('source') %} | ||
{% set cols = adapter.get_columns_in_table(source.schema, source.name) %} | ||
|
||
select | ||
{% for col in cols %} | ||
{{ col.name }} | ||
{% if not loop.last %}, {% endif %} | ||
{% endfor %} | ||
|
||
from {{ source }} |
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,8 @@ | ||
|
||
|
||
adapters: | ||
constraints: | ||
not_null: | ||
- field_1 | ||
- field_2 | ||
- field_3 |
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,6 @@ | ||
|
||
select | ||
1 as field_1, | ||
2 as field_2, | ||
3 as field_3 | ||
|
33 changes: 33 additions & 0 deletions
33
test/integration/022_bigquery_test/test_bigquery_adapter_functions.py
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,33 @@ | ||
from nose.plugins.attrib import attr | ||
from test.integration.base import DBTIntegrationTest, FakeArgs | ||
|
||
|
||
class TestBigqueryAdapterFunctions(DBTIntegrationTest): | ||
|
||
@property | ||
def schema(self): | ||
return "bigquery_test_022" | ||
|
||
@property | ||
def models(self): | ||
return "test/integration/022_bigquery_test/adapter-models" | ||
|
||
@property | ||
def profile_config(self): | ||
return self.bigquery_profile() | ||
|
||
@attr(type='bigquery') | ||
def test__bigquery_date_partitioning(self): | ||
self.use_profile('bigquery') | ||
self.use_default_project() | ||
self.run_dbt() | ||
|
||
test_results = self.run_dbt(['test']) | ||
|
||
self.assertTrue(len(test_results) > 0) | ||
for result in test_results: | ||
self.assertFalse(result.errored) | ||
self.assertFalse(result.skipped) | ||
# status = # of failing rows | ||
self.assertEqual(result.status, 0) | ||
|
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.
i want to talk to you about error behavior in adapters, but this is fine for now