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

Expose the cache in dbt's rendering contexts (#1683) #1770

Merged

Conversation

beckjake
Copy link
Contributor

@beckjake beckjake commented Sep 18, 2019

Fixes #1683

Expose some cache manipulation methods to materializations and macros. As part of that I moved around where we do our cache changes in dbt itself. This is a breaking change - I've updated the changelog accordingly.

I also spent some time/energy getting mypy happy with this part of the code.

I'm not sure, but it's possible that we should be stubbing these out during parsing with @available.parse_none instead of just @available.

@cla-bot cla-bot bot added the cla:yes label Sep 18, 2019
@beckjake beckjake changed the title Expose the cache in dbt's rendering contexts Expose the cache in dbt's rendering contexts (#1683) Sep 18, 2019
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broadly looks good to me, but I added one comment worth discussing here.

core/dbt/include/global_project/macros/adapters/common.sql Outdated Show resolved Hide resolved
Jacob Beck added 2 commits September 20, 2019 14:05
make new cache manipulation methods
mark the methods available to the sql context
move cache manipulation into appropriate macros and methods
update the changelog
fix some type checking
Materializations now return a list of relations they added
 - those get added to the cache
Updated existing materializations
Added backwards compatibility support + a deprecation warning
@beckjake beckjake force-pushed the feature/expose-cache-to-materializations branch from 1946b2f to 145e0b2 Compare September 20, 2019 20:06
core/dbt/deprecations.py Outdated Show resolved Hide resolved
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a link for the deprecation warning -- this is ready to merge once that's updated!

Include the actual docs link!

Co-Authored-By: Drew Banin <drew@fishtownanalytics.com>
@beckjake beckjake merged commit f9c8442 into dev/louisa-may-alcott Sep 23, 2019
@beckjake beckjake deleted the feature/expose-cache-to-materializations branch September 23, 2019 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Difference between behaviour of already_exists and get_relation
2 participants