Initialize lift + shift for cross-db macros #594
Closed
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.
This is a:
Description & motivation
See:
Bonus!
Install test cases for
dateadd
+datediff
fromdbt-tests-adapter
, override just enough to verify backwards compatibility when the macros are called asdbt_utils.dateadd
anddbt_utils.datediff
.How much backwards compatibility do we care about? There are three options:
dbt-utils
withrequire-dbt-version: [">=1.2.0", "<2.0.0"]
dbt-core
anddbt-utils
.) Callingdbt_utils.dateadd
+dbt_utils.datediff
will keep working, but some custom dispatch rules won't keep working after upgrading to v1.2, since we're only dispatching on older versions.My preference would be for option 1 or 2. If we go with option 2, we should pick a future version of
dbt-core
/dbt-utils
where we remove backwards compatibility. (Maybe utils major version 1?)Checklist
star()
source)using thelimit_zero()
macro in place of the literal string:limit 0
usingdbt_utils.type_*
macros instead of explicit datatypes (e.g.dbt_utils.type_timestamp()
instead ofTIMESTAMP
I have updated the README.md (if applicable)I have added tests & descriptions to my models (and macros if applicable)