Replies: 5 comments 8 replies
-
Thanks for the overview (as usual), @dataders! There is a pending question from our side in terms of test coverage: is there a recommendation around what tests must be included in each external adapter's test suite? Since |
Beta Was this translation helpful? Give feedback.
-
Is there discussion of this change somewhere? quote_policy: SnowflakeQuotePolicy = field(default_factory=lambda: SnowflakeQuotePolicy()) Are all policies required to be a |
Beta Was this translation helpful? Give feedback.
-
When attempting to upgrade the dbt-athena adapter (PR: dbt-labs/dbt-athena#134) I'm having few issues:
Overall the core functionalities are working, but the above is preventing us to move further with merging and releasing to the new version. |
Beta Was this translation helpful? Give feedback.
-
Is the new tests/adapter/dbt/tests/adapter/utils/test_timestamps.py test only applicable to postgres and snowflake adapters? I see this in the changes for the relevant macros in timestamp.sql:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
This discussion is for communicating to adapter maintainers the scope of work needed to make use of the changes in 1.4.0. If you have questions and concerns, please ask them here for posterity.
For the guide to upgrading an adapter to be compatible with dbt-core=1.3.0, please see #6011.
The latest release cut for 1.4.0,
dbt-core==1.4.0rc1
, was published on January 11, 2023 (PyPI | Github). We are targeting releasing the official cut of 1.4.0 in time for January 25, 2023. We ask that adapter maintainers strive to release an official version of corresponding adapter package by February 8, 2023.Upgrade dependencies
Be sure to also upgrade the version of
dbt-tests-adapter
Add support for Python 3.11
The long wait is over for Guido's MSFT-funded foray into speeding up his pet project. However these performance improvements are not immediately realizble in dbt until key package dependencies first start supporting (and testing against) Python 3.11. As of the time of writing (1/16/23), most Python database driver libraries/packages support Python 3.11
If possible, please update your adapter to support Python 3.11 and also test against it. Verified adapters must test against this version, and adapters included in cloud must test against all currently supported minor version of the Python 3 (i.e. 3.7 though 3.11).
Consolidate timestamp functions & macros
Most of the work was done in core (#5521 https://github.com/dbt-labs/dbt-bigquery/pull/323/files). Feel free to dive in to the PRs and related issues, but my TL;DR is that just because macros had the same name across adapters didn't mean the implementation was the same or was guaranteed to return the same datatype. The consensus is now to standardize timestamp-related macros to make use of the convert_timezone() macro and built in Python logic.
There is a new adapter-zone test to implement to ensure things are hunky-dory:
dbt.tests.adapter.utils.test_timestamps.BaseCurrentTimestamps
Any adapter-specific override of the following time-related macros should now live in
macros/utils/timestamps.sql
-
current_timestamp
-
snapshot_string_as_time
-
snapshot_get_time
Relatedly, if you maintain a shim of dbt-utils that overrides these macros, changes similar to dbt-labs/dbt-utils#694 may be required
Replace deprecated exception functions
With the exception to some logging upgrades and small tweaks, dbt-core's Exceptions library (core/dbt/exceptions.py) has sat largely dormant for nearly three years. Strong exception handling interface is key to a solid API upon which other teams and tools can rely.
#6347
dbt-labs/dbt-snowflake#366
RuntimeException
->DbtRuntimeError
DatabaseException
->DbtDatabaseError
raise_compiler_error()
->CompilationError
Incremental Predicates
Incremental Predicates is a new feature for 1.4. See #5702 for more information
There are also tests (
TestIncrementalPredicatesDeleteInsert
,TestPredicatesDeleteInsert
)that can be used to validate the implementation if your adapter supports either of the mentioned incremental strategies.Additional Tests
Incremental Tests
If your adapter has a custom incremental "unique key" strategy and/or materializaiton
TestIncrementalUniqueKey
is a recommended approach#4958
Query Comment Tests
If your data platform supports query comments, then #5971 migrates the related tests to the adapter zone for you to implement (see dbt-labs/dbt-redshift#197).
TestChangeRelationTypes
TODO explain the value of this test.... @colin-rogers-dbt? #6054 dbt-labs/dbt-redshift#203
Example adapter diffs
dbt-labs/dbt-redshift@v1.3.0...v1.4.0rc1
dbt-labs/dbt-bigquery@v1.3.0...v1.4.0rc1
dbt-labs/dbt-snowflake@v1.3.0...v1.4.0rc1
dbt-labs/dbt-spark@v1.3.0...v1.4.0rc1
dbt-labs/dbt-bigquery@v1.3.0...v1.4.0rc1
Beta Was this translation helpful? Give feedback.
All reactions