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

Add MaterializedView relation type, update Snowflake adapter #1432

Merged
merged 1 commit into from
May 2, 2019

Conversation

adrianisk
Copy link
Contributor

Fix for issue #1430, re-doing #1431 on the dev/0.13.1 branch

-- Adds MaterializedView to the list of RelationTypes in the BaseRelation class
-- Updates the snowflake__list_relations_without_caching macro to handle 'MATERIALIZED VIEW' table_type

I didn't find any unit tests for the BaseRelation parsing, so I just tested manually. Let me know if there's a good way to add a test for this.

Prior to the fix running a model in this project returned:

* Deprecation Warning: The adapter function `adapter.already_exists` is deprecated and will be removed in
 a future release of dbt. Please use `adapter.get_relation` instead.
 Documentation for get_relation can be found here:
 https://docs.getdbt.com/reference#adapter

Encountered an error:
Runtime Error
  Invalid arguments passed to "SnowflakeRelation" instance: type.'MATERIALIZED VIEW' is not one of ['table', 'view', 'cte', None]  

After the fix the model runs successfully:

Running with dbt=0.13.0
* Deprecation Warning: The adapter function `adapter.already_exists` is deprecated and will be removed in
 a future release of dbt. Please use `adapter.get_relation` instead.
 Documentation for get_relation can be found here:
 https://docs.getdbt.com/reference#adapter

Found 140 models, 364 tests, 0 archives, 0 analyses, 103 macros, 0 operations, 0 seed files, 0 sources

09:31:09 | Concurrency: 3 threads (target='production_bi')
09:31:09 |
09:31:09 | 1 of 1 START table model bi.the_model................... [RUN]
09:31:17 | 1 of 1 OK created table model bi.the_model.............. [SUCCESS 1 in 8.01s]
09:31:17 |
09:31:17 | Finished running 1 table models in 14.96s.

Completed successfully

Done. PASS=1 ERROR=0 SKIP=0 TOTAL=1

@drewbanin drewbanin self-requested a review April 30, 2019 17:03
@drewbanin
Copy link
Contributor

Thanks @adriank-convoy! I just kicked off the tests here - we'll be good to merge this for 0.13.1 when they pass :)

@beckjake
Copy link
Contributor

beckjake commented May 1, 2019

I can't get github to display it, but this passed CI here: https://dev.azure.com/fishtown-analytics/dbt/_build/results?buildId=5

@drewbanin drewbanin requested review from beckjake and removed request for drewbanin May 2, 2019 01:00
@drewbanin
Copy link
Contributor

@beckjake can you merge this and then work with @cmcarthur to cut an alpha of 0.13.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants