dbt-adapters 1.11.0__tar.gz → 1.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbt-adapters might be problematic. Click here for more details.
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/PKG-INFO +11 -8
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/README.md +5 -3
- dbt_adapters-1.12.0/dbt/adapters/__about__.py +1 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/impl.py +73 -12
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/capability.py +3 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/adapter_types_pb2.py +17 -7
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/sql/connections.py +63 -2
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/relation.sql +5 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +49 -5
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql +1 -1
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/snapshots/strategies.sql +8 -4
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/pyproject.toml +10 -3
- dbt_adapters-1.11.0/dbt/adapters/__about__.py +0 -1
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/.gitignore +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/LICENSE +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/README.md +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/column.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/connections.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/meta.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/plugin.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/query_headers.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/base/relation.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/cache.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/clients/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/clients/jinja.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/contracts/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/contracts/connection.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/contracts/macros.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/contracts/relation.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/README.md +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/adapter_types.proto +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/base_types.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/logging.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/events/types.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/exceptions/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/exceptions/alias.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/exceptions/cache.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/exceptions/compilation.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/exceptions/connection.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/exceptions/database.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/factory.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/protocol.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/py.typed +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/cursor.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/description.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/execute.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/fetchall.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/fetchmany.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/fetchone.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/cursor/rowcount.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/record/handle.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/reference_keys.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/relation_configs/README.md +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/relation_configs/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/relation_configs/config_base.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/relation_configs/config_change.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/relation_configs/config_validation.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/sql/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/sql/impl.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/utils.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/__init__.py +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/dbt_project.yml +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/docs/overview.md +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/apply_grants.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/columns.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/freshness.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/indexes.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/metadata.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/persist_docs.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/schema.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/show.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/timestamps.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/validate_sql.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/etc/datetime.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/etc/statement.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/generic_test_sql/accepted_values.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/generic_test_sql/not_null.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/generic_test_sql/relationships.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/generic_test_sql/unique.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/get_custom_name/get_custom_alias.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/get_custom_name/get_custom_database.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/get_custom_name/get_custom_schema.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/configs.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/hooks.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/clone/can_clone_table.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/clone/clone.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/clone/create_or_replace_clone.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/incremental/column_helpers.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/incremental/incremental.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/incremental/is_incremental.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/incremental/merge.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/incremental/on_schema_change.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/incremental/strategies.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/materialized_view.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/table.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/models/view.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/seeds/helpers.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/seeds/seed.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/tests/helpers.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/tests/test.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/tests/unit.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/materializations/tests/where_subquery.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/python_model/python.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/column/columns_spec_ddl.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/create.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/create_backup.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/create_intermediate.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/drop.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/drop_backup.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/materialized_view/alter.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/materialized_view/create.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/materialized_view/drop.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/materialized_view/refresh.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/materialized_view/rename.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/materialized_view/replace.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/rename.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/rename_intermediate.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/replace.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/schema.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/table/create.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/table/drop.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/table/rename.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/table/replace.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/view/create.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/view/drop.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/view/rename.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/view/replace.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/any_value.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/array_append.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/array_concat.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/array_construct.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/bool_or.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/cast.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/cast_bool_to_text.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/concat.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/data_types.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/date.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/date_spine.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/date_trunc.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/dateadd.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/datediff.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/escape_single_quotes.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/except.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/generate_series.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/hash.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/intersect.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/last_day.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/length.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/listagg.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/literal.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/position.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/replace.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/right.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/safe_cast.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/split_part.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/tests/generic/builtin.sql +0 -0
- {dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dbt-adapters
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.12.0
|
|
4
4
|
Summary: The set of adapter protocols and base functionality that supports integration with dbt-core
|
|
5
5
|
Project-URL: Homepage, https://github.com/dbt-labs/dbt-adapters
|
|
6
6
|
Project-URL: Documentation, https://docs.getdbt.com
|
|
@@ -9,6 +9,7 @@ Project-URL: Issues, https://github.com/dbt-labs/dbt-adapters/issues
|
|
|
9
9
|
Project-URL: Changelog, https://github.com/dbt-labs/dbt-adapters/blob/main/CHANGELOG.md
|
|
10
10
|
Author-email: dbt Labs <info@dbtlabs.com>
|
|
11
11
|
Maintainer-email: dbt Labs <info@dbtlabs.com>
|
|
12
|
+
License-File: LICENSE
|
|
12
13
|
Keywords: adapter,adapters,database,dbt,dbt Cloud,dbt Core,dbt Labs,dbt-core,elt
|
|
13
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
15
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -21,9 +22,9 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
21
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
23
|
Requires-Python: >=3.9.0
|
|
23
24
|
Requires-Dist: agate<2.0,>=1.0
|
|
24
|
-
Requires-Dist: dbt-common<2.0,>=1.
|
|
25
|
-
Requires-Dist: mashumaro[msgpack]<
|
|
26
|
-
Requires-Dist: protobuf<
|
|
25
|
+
Requires-Dist: dbt-common<2.0,>=1.13
|
|
26
|
+
Requires-Dist: mashumaro[msgpack]<3.15,>=3.9
|
|
27
|
+
Requires-Dist: protobuf<6.0,>=5.0
|
|
27
28
|
Requires-Dist: pytz>=2015.7
|
|
28
29
|
Requires-Dist: typing-extensions<5.0,>=4.0
|
|
29
30
|
Description-Content-Type: text/markdown
|
|
@@ -32,7 +33,7 @@ Description-Content-Type: text/markdown
|
|
|
32
33
|
<img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="500"/>
|
|
33
34
|
</p>
|
|
34
35
|
|
|
35
|
-
# dbt-
|
|
36
|
+
# dbt-adapters
|
|
36
37
|
|
|
37
38
|
This package is responsible for:
|
|
38
39
|
|
|
@@ -40,9 +41,11 @@ This package is responsible for:
|
|
|
40
41
|
- caching information from databases
|
|
41
42
|
- determining how relations are defined
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
In this repo there is also our testing suite used for tesing adapter functionality
|
|
45
|
+
|
|
46
|
+
# Adapters
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
There are two major adapter types: base and sql
|
|
46
49
|
|
|
47
50
|
## `base`
|
|
48
51
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="500"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
# dbt-
|
|
5
|
+
# dbt-adapters
|
|
6
6
|
|
|
7
7
|
This package is responsible for:
|
|
8
8
|
|
|
@@ -10,9 +10,11 @@ This package is responsible for:
|
|
|
10
10
|
- caching information from databases
|
|
11
11
|
- determining how relations are defined
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
In this repo there is also our testing suite used for tesing adapter functionality
|
|
14
|
+
|
|
15
|
+
# Adapters
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
There are two major adapter types: base and sql
|
|
16
18
|
|
|
17
19
|
## `base`
|
|
18
20
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "1.12.0"
|
|
@@ -98,6 +98,13 @@ GET_CATALOG_MACRO_NAME = "get_catalog"
|
|
|
98
98
|
GET_CATALOG_RELATIONS_MACRO_NAME = "get_catalog_relations"
|
|
99
99
|
FRESHNESS_MACRO_NAME = "collect_freshness"
|
|
100
100
|
GET_RELATION_LAST_MODIFIED_MACRO_NAME = "get_relation_last_modified"
|
|
101
|
+
DEFAULT_BASE_BEHAVIOR_FLAGS = [
|
|
102
|
+
{
|
|
103
|
+
"name": "require_batched_execution_for_custom_microbatch_strategy",
|
|
104
|
+
"default": False,
|
|
105
|
+
"docs_url": "https://docs.getdbt.com/docs/build/incremental-microbatch",
|
|
106
|
+
}
|
|
107
|
+
]
|
|
101
108
|
|
|
102
109
|
|
|
103
110
|
class ConstraintSupport(str, Enum):
|
|
@@ -199,6 +206,14 @@ class FreshnessResponse(TypedDict):
|
|
|
199
206
|
age: float # age in seconds
|
|
200
207
|
|
|
201
208
|
|
|
209
|
+
class SnapshotStrategy(TypedDict):
|
|
210
|
+
unique_key: Optional[str]
|
|
211
|
+
updated_at: Optional[str]
|
|
212
|
+
row_changed: Optional[str]
|
|
213
|
+
scd_id: Optional[str]
|
|
214
|
+
hard_deletes: Optional[str]
|
|
215
|
+
|
|
216
|
+
|
|
202
217
|
class BaseAdapter(metaclass=AdapterMeta):
|
|
203
218
|
"""The BaseAdapter provides an abstract base class for adapters.
|
|
204
219
|
|
|
@@ -273,8 +288,7 @@ class BaseAdapter(metaclass=AdapterMeta):
|
|
|
273
288
|
self.connections = self.ConnectionManager(config, mp_context)
|
|
274
289
|
self._macro_resolver: Optional[MacroResolverProtocol] = None
|
|
275
290
|
self._macro_context_generator: Optional[MacroContextGeneratorCallable] = None
|
|
276
|
-
|
|
277
|
-
self.behavior = [] # type: ignore
|
|
291
|
+
self.behavior = DEFAULT_BASE_BEHAVIOR_FLAGS # type: ignore
|
|
278
292
|
|
|
279
293
|
###
|
|
280
294
|
# Methods to set / access a macro resolver
|
|
@@ -314,14 +328,10 @@ class BaseAdapter(metaclass=AdapterMeta):
|
|
|
314
328
|
def _behavior_flags(self) -> List[BehaviorFlag]:
|
|
315
329
|
"""
|
|
316
330
|
This method should be overwritten by adapter maintainers to provide platform-specific flags
|
|
331
|
+
|
|
332
|
+
The BaseAdapter should NOT include any global flags here as those should be defined via DEFAULT_BASE_BEHAVIOR_FLAGS
|
|
317
333
|
"""
|
|
318
|
-
return [
|
|
319
|
-
{
|
|
320
|
-
"name": "require_batched_execution_for_custom_microbatch_strategy",
|
|
321
|
-
"default": False,
|
|
322
|
-
"docs_url": "https://docs.getdbt.com/docs/build/incremental-microbatch",
|
|
323
|
-
}
|
|
324
|
-
]
|
|
334
|
+
return []
|
|
325
335
|
|
|
326
336
|
###
|
|
327
337
|
# Methods that pass through to the connection manager
|
|
@@ -793,8 +803,8 @@ class BaseAdapter(metaclass=AdapterMeta):
|
|
|
793
803
|
columns = self.get_columns_in_relation(relation)
|
|
794
804
|
names = set(c.name.lower() for c in columns)
|
|
795
805
|
missing = []
|
|
796
|
-
# Note: we're not checking dbt_updated_at here because
|
|
797
|
-
# always present.
|
|
806
|
+
# Note: we're not checking dbt_updated_at or dbt_is_deleted here because they
|
|
807
|
+
# aren't always present.
|
|
798
808
|
for column in ("dbt_scd_id", "dbt_valid_from", "dbt_valid_to"):
|
|
799
809
|
desired = column_names[column] if column_names else column
|
|
800
810
|
if desired not in names:
|
|
@@ -803,6 +813,28 @@ class BaseAdapter(metaclass=AdapterMeta):
|
|
|
803
813
|
if missing:
|
|
804
814
|
raise SnapshotTargetNotSnapshotTableError(missing)
|
|
805
815
|
|
|
816
|
+
@available.parse_none
|
|
817
|
+
def assert_valid_snapshot_target_given_strategy(
|
|
818
|
+
self, relation: BaseRelation, column_names: Dict[str, str], strategy: SnapshotStrategy
|
|
819
|
+
) -> None:
|
|
820
|
+
# Assert everything we can with the legacy function.
|
|
821
|
+
self.valid_snapshot_target(relation, column_names)
|
|
822
|
+
|
|
823
|
+
# Now do strategy-specific checks.
|
|
824
|
+
# TODO: Make these checks more comprehensive.
|
|
825
|
+
if strategy.get("hard_deletes", None) == "new_record":
|
|
826
|
+
columns = self.get_columns_in_relation(relation)
|
|
827
|
+
names = set(c.name.lower() for c in columns)
|
|
828
|
+
missing = []
|
|
829
|
+
|
|
830
|
+
for column in ("dbt_is_deleted",):
|
|
831
|
+
desired = column_names[column] if column_names else column
|
|
832
|
+
if desired not in names:
|
|
833
|
+
missing.append(desired)
|
|
834
|
+
|
|
835
|
+
if missing:
|
|
836
|
+
raise SnapshotTargetNotSnapshotTableError(missing)
|
|
837
|
+
|
|
806
838
|
@available.parse_none
|
|
807
839
|
def expand_target_column_types(
|
|
808
840
|
self, from_relation: BaseRelation, to_relation: BaseRelation
|
|
@@ -1578,8 +1610,14 @@ class BaseAdapter(metaclass=AdapterMeta):
|
|
|
1578
1610
|
return ["append"]
|
|
1579
1611
|
|
|
1580
1612
|
def builtin_incremental_strategies(self):
|
|
1613
|
+
"""
|
|
1614
|
+
List of possible builtin strategies for adapters
|
|
1615
|
+
|
|
1616
|
+
Microbatch is added by _default_. It is only not added when the behavior flag
|
|
1617
|
+
`require_batched_execution_for_custom_microbatch_strategy` is True.
|
|
1618
|
+
"""
|
|
1581
1619
|
builtin_strategies = ["append", "delete+insert", "merge", "insert_overwrite"]
|
|
1582
|
-
if self.behavior.require_batched_execution_for_custom_microbatch_strategy.no_warn:
|
|
1620
|
+
if not self.behavior.require_batched_execution_for_custom_microbatch_strategy.no_warn:
|
|
1583
1621
|
builtin_strategies.append("microbatch")
|
|
1584
1622
|
|
|
1585
1623
|
return builtin_strategies
|
|
@@ -1787,6 +1825,29 @@ class BaseAdapter(metaclass=AdapterMeta):
|
|
|
1787
1825
|
"""
|
|
1788
1826
|
return {}
|
|
1789
1827
|
|
|
1828
|
+
@available.parse_none
|
|
1829
|
+
@classmethod
|
|
1830
|
+
def get_hard_deletes_behavior(cls, config):
|
|
1831
|
+
"""Check the hard_deletes config enum, and the legacy invalidate_hard_deletes
|
|
1832
|
+
config flag in order to determine which behavior should be used for deleted
|
|
1833
|
+
records in a snapshot. The default is to ignore them."""
|
|
1834
|
+
invalidate_hard_deletes = config.get("invalidate_hard_deletes", None)
|
|
1835
|
+
hard_deletes = config.get("hard_deletes", None)
|
|
1836
|
+
|
|
1837
|
+
if invalidate_hard_deletes is not None and hard_deletes is not None:
|
|
1838
|
+
raise DbtValidationError(
|
|
1839
|
+
"You cannot set both the invalidate_hard_deletes and hard_deletes config properties on the same snapshot."
|
|
1840
|
+
)
|
|
1841
|
+
|
|
1842
|
+
if invalidate_hard_deletes or hard_deletes == "invalidate":
|
|
1843
|
+
return "invalidate"
|
|
1844
|
+
elif hard_deletes == "new_record":
|
|
1845
|
+
return "new_record"
|
|
1846
|
+
elif hard_deletes is None or hard_deletes == "ignore":
|
|
1847
|
+
return "ignore"
|
|
1848
|
+
|
|
1849
|
+
raise DbtValidationError("Invalid setting for property hard_deletes.")
|
|
1850
|
+
|
|
1790
1851
|
|
|
1791
1852
|
COLUMNS_EQUAL_SQL = """
|
|
1792
1853
|
with diff_count as (
|
|
@@ -21,6 +21,9 @@ class Capability(str, Enum):
|
|
|
21
21
|
"""Indicates support for getting catalog information including table-level and column-level metadata for a single
|
|
22
22
|
relation."""
|
|
23
23
|
|
|
24
|
+
MicrobatchConcurrency = "MicrobatchConcurrency"
|
|
25
|
+
"""Indicates support running the microbatch incremental materialization strategy concurrently across threads."""
|
|
26
|
+
|
|
24
27
|
|
|
25
28
|
class Support(str, Enum):
|
|
26
29
|
Unknown = "Unknown"
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
3
4
|
# source: adapter_types.proto
|
|
5
|
+
# Protobuf Python Version: 5.28.3
|
|
4
6
|
"""Generated protocol buffer code."""
|
|
5
7
|
from google.protobuf import descriptor as _descriptor
|
|
6
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
7
10
|
from google.protobuf import symbol_database as _symbol_database
|
|
8
11
|
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
5,
|
|
15
|
+
28,
|
|
16
|
+
3,
|
|
17
|
+
'',
|
|
18
|
+
'adapter_types.proto'
|
|
19
|
+
)
|
|
9
20
|
# @@protoc_insertion_point(imports)
|
|
10
21
|
|
|
11
22
|
_sym_db = _symbol_database.Default()
|
|
@@ -20,13 +31,12 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x61\x64\x61pt
|
|
|
20
31
|
_globals = globals()
|
|
21
32
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
22
33
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'adapter_types_pb2', _globals)
|
|
23
|
-
if _descriptor._USE_C_DESCRIPTORS
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_ADAPTERCOMMONEVENTINFO_EXTRAENTRY.
|
|
27
|
-
|
|
28
|
-
_CACHEDUMPGRAPH_DUMPENTRY.
|
|
29
|
-
_CACHEDUMPGRAPH_DUMPENTRY._serialized_options = b'8\001'
|
|
34
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
|
+
DESCRIPTOR._loaded_options = None
|
|
36
|
+
_globals['_ADAPTERCOMMONEVENTINFO_EXTRAENTRY']._loaded_options = None
|
|
37
|
+
_globals['_ADAPTERCOMMONEVENTINFO_EXTRAENTRY']._serialized_options = b'8\001'
|
|
38
|
+
_globals['_CACHEDUMPGRAPH_DUMPENTRY']._loaded_options = None
|
|
39
|
+
_globals['_CACHEDUMPGRAPH_DUMPENTRY']._serialized_options = b'8\001'
|
|
30
40
|
_globals['_ADAPTERCOMMONEVENTINFO']._serialized_start=100
|
|
31
41
|
_globals['_ADAPTERCOMMONEVENTINFO']._serialized_end=399
|
|
32
42
|
_globals['_ADAPTERCOMMONEVENTINFO_EXTRAENTRY']._serialized_start=355
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import abc
|
|
2
2
|
import time
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import (
|
|
4
|
+
Any,
|
|
5
|
+
Dict,
|
|
6
|
+
Iterable,
|
|
7
|
+
Iterator,
|
|
8
|
+
List,
|
|
9
|
+
Optional,
|
|
10
|
+
Tuple,
|
|
11
|
+
TYPE_CHECKING,
|
|
12
|
+
Type,
|
|
13
|
+
)
|
|
4
14
|
|
|
5
15
|
from dbt_common.events.contextvars import get_node_info
|
|
6
16
|
from dbt_common.events.functions import fire_event
|
|
@@ -18,6 +28,7 @@ from dbt.adapters.events.types import (
|
|
|
18
28
|
SQLCommit,
|
|
19
29
|
SQLQuery,
|
|
20
30
|
SQLQueryStatus,
|
|
31
|
+
AdapterEventDebug,
|
|
21
32
|
)
|
|
22
33
|
|
|
23
34
|
if TYPE_CHECKING:
|
|
@@ -61,7 +72,50 @@ class SQLConnectionManager(BaseConnectionManager):
|
|
|
61
72
|
auto_begin: bool = True,
|
|
62
73
|
bindings: Optional[Any] = None,
|
|
63
74
|
abridge_sql_log: bool = False,
|
|
75
|
+
retryable_exceptions: Tuple[Type[Exception], ...] = tuple(),
|
|
76
|
+
retry_limit: int = 1,
|
|
64
77
|
) -> Tuple[Connection, Any]:
|
|
78
|
+
"""
|
|
79
|
+
Retry function encapsulated here to avoid commitment to some
|
|
80
|
+
user-facing interface. Right now, Redshift commits to a 1 second
|
|
81
|
+
retry timeout so this serves as a default.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
def _execute_query_with_retry(
|
|
85
|
+
cursor: Any,
|
|
86
|
+
sql: str,
|
|
87
|
+
bindings: Optional[Any],
|
|
88
|
+
retryable_exceptions: Tuple[Type[Exception], ...],
|
|
89
|
+
retry_limit: int,
|
|
90
|
+
attempt: int,
|
|
91
|
+
):
|
|
92
|
+
"""
|
|
93
|
+
A success sees the try exit cleanly and avoid any recursive
|
|
94
|
+
retries. Failure begins a sleep and retry routine.
|
|
95
|
+
"""
|
|
96
|
+
try:
|
|
97
|
+
cursor.execute(sql, bindings)
|
|
98
|
+
except retryable_exceptions as e:
|
|
99
|
+
# Cease retries and fail when limit is hit.
|
|
100
|
+
if attempt >= retry_limit:
|
|
101
|
+
raise e
|
|
102
|
+
|
|
103
|
+
fire_event(
|
|
104
|
+
AdapterEventDebug(
|
|
105
|
+
message=f"Got a retryable error {type(e)}. {retry_limit-attempt} retries left. Retrying in 1 second.\nError:\n{e}"
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
time.sleep(1)
|
|
109
|
+
|
|
110
|
+
return _execute_query_with_retry(
|
|
111
|
+
cursor=cursor,
|
|
112
|
+
sql=sql,
|
|
113
|
+
bindings=bindings,
|
|
114
|
+
retryable_exceptions=retryable_exceptions,
|
|
115
|
+
retry_limit=retry_limit,
|
|
116
|
+
attempt=attempt + 1,
|
|
117
|
+
)
|
|
118
|
+
|
|
65
119
|
connection = self.get_thread_connection()
|
|
66
120
|
if auto_begin and connection.transaction_open is False:
|
|
67
121
|
self.begin()
|
|
@@ -90,7 +144,14 @@ class SQLConnectionManager(BaseConnectionManager):
|
|
|
90
144
|
pre = time.perf_counter()
|
|
91
145
|
|
|
92
146
|
cursor = connection.handle.cursor()
|
|
93
|
-
|
|
147
|
+
_execute_query_with_retry(
|
|
148
|
+
cursor=cursor,
|
|
149
|
+
sql=sql,
|
|
150
|
+
bindings=bindings,
|
|
151
|
+
retryable_exceptions=retryable_exceptions,
|
|
152
|
+
retry_limit=retry_limit,
|
|
153
|
+
attempt=1,
|
|
154
|
+
)
|
|
94
155
|
|
|
95
156
|
result = self.get_response(cursor)
|
|
96
157
|
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/relation.sql
RENAMED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
{% endmacro %}
|
|
8
8
|
|
|
9
9
|
{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}
|
|
10
|
+
{#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}
|
|
11
|
+
{% if suffix == '__dbt_tmp' and model.batch %}
|
|
12
|
+
{% set suffix = suffix ~ '_' ~ model.batch.id %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
|
|
10
15
|
{{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}
|
|
11
16
|
{% endmacro %}
|
|
12
17
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
{% endmacro %}
|
|
36
36
|
|
|
37
37
|
{% macro get_snapshot_table_column_names() %}
|
|
38
|
-
{{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at'}) }}
|
|
38
|
+
{{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}
|
|
39
39
|
{% endmacro %}
|
|
40
40
|
|
|
41
41
|
{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
from snapshot_query
|
|
83
83
|
),
|
|
84
84
|
|
|
85
|
-
{%- if strategy.
|
|
85
|
+
{%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}
|
|
86
86
|
|
|
87
87
|
deletes_source_data as (
|
|
88
88
|
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
select
|
|
97
97
|
'insert' as dbt_change_type,
|
|
98
98
|
source_data.*
|
|
99
|
+
{%- if strategy.hard_deletes == 'new_record' -%}
|
|
100
|
+
,'False' as {{ columns.dbt_is_deleted }}
|
|
101
|
+
{%- endif %}
|
|
99
102
|
|
|
100
103
|
from insertions_source_data as source_data
|
|
101
104
|
left outer join snapshotted_data
|
|
@@ -113,6 +116,9 @@
|
|
|
113
116
|
'update' as dbt_change_type,
|
|
114
117
|
source_data.*,
|
|
115
118
|
snapshotted_data.{{ columns.dbt_scd_id }}
|
|
119
|
+
{%- if strategy.hard_deletes == 'new_record' -%}
|
|
120
|
+
, snapshotted_data.{{ columns.dbt_is_deleted }}
|
|
121
|
+
{%- endif %}
|
|
116
122
|
|
|
117
123
|
from updates_source_data as source_data
|
|
118
124
|
join snapshotted_data
|
|
@@ -122,9 +128,8 @@
|
|
|
122
128
|
)
|
|
123
129
|
)
|
|
124
130
|
|
|
125
|
-
{%- if strategy.
|
|
131
|
+
{%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}
|
|
126
132
|
,
|
|
127
|
-
|
|
128
133
|
deletes as (
|
|
129
134
|
|
|
130
135
|
select
|
|
@@ -134,7 +139,38 @@
|
|
|
134
139
|
{{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},
|
|
135
140
|
{{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},
|
|
136
141
|
snapshotted_data.{{ columns.dbt_scd_id }}
|
|
142
|
+
{%- if strategy.hard_deletes == 'new_record' -%}
|
|
143
|
+
, snapshotted_data.{{ columns.dbt_is_deleted }}
|
|
144
|
+
{%- endif %}
|
|
145
|
+
from snapshotted_data
|
|
146
|
+
left join deletes_source_data as source_data
|
|
147
|
+
on {{ unique_key_join_on(strategy.unique_key, "snapshotted_data", "source_data") }}
|
|
148
|
+
where {{ unique_key_is_null(strategy.unique_key, "source_data") }}
|
|
149
|
+
)
|
|
150
|
+
{%- endif %}
|
|
151
|
+
|
|
152
|
+
{%- if strategy.hard_deletes == 'new_record' %}
|
|
153
|
+
{% set source_sql_cols = get_column_schema_from_query(source_sql) %}
|
|
154
|
+
,
|
|
155
|
+
deletion_records as (
|
|
137
156
|
|
|
157
|
+
select
|
|
158
|
+
'insert' as dbt_change_type,
|
|
159
|
+
{%- for col in source_sql_cols -%}
|
|
160
|
+
snapshotted_data.{{ adapter.quote(col.column) }},
|
|
161
|
+
{% endfor -%}
|
|
162
|
+
{%- if strategy.unique_key | is_list -%}
|
|
163
|
+
{%- for key in strategy.unique_key -%}
|
|
164
|
+
snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},
|
|
165
|
+
{% endfor -%}
|
|
166
|
+
{%- else -%}
|
|
167
|
+
snapshotted_data.dbt_unique_key as dbt_unique_key,
|
|
168
|
+
{% endif -%}
|
|
169
|
+
{{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},
|
|
170
|
+
{{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},
|
|
171
|
+
snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},
|
|
172
|
+
snapshotted_data.{{ columns.dbt_scd_id }},
|
|
173
|
+
'True' as {{ columns.dbt_is_deleted }}
|
|
138
174
|
from snapshotted_data
|
|
139
175
|
left join deletes_source_data as source_data
|
|
140
176
|
on {{ unique_key_join_on(strategy.unique_key, "snapshotted_data", "source_data") }}
|
|
@@ -145,10 +181,15 @@
|
|
|
145
181
|
select * from insertions
|
|
146
182
|
union all
|
|
147
183
|
select * from updates
|
|
148
|
-
{%- if strategy.
|
|
184
|
+
{%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}
|
|
149
185
|
union all
|
|
150
186
|
select * from deletes
|
|
151
187
|
{%- endif %}
|
|
188
|
+
{%- if strategy.hard_deletes == 'new_record' %}
|
|
189
|
+
union all
|
|
190
|
+
select * from deletion_records
|
|
191
|
+
{%- endif %}
|
|
192
|
+
|
|
152
193
|
|
|
153
194
|
{%- endmacro %}
|
|
154
195
|
|
|
@@ -165,6 +206,9 @@
|
|
|
165
206
|
{{ strategy.updated_at }} as {{ columns.dbt_updated_at }},
|
|
166
207
|
{{ strategy.updated_at }} as {{ columns.dbt_valid_from }},
|
|
167
208
|
{{ get_dbt_valid_to_current(strategy, columns) }}
|
|
209
|
+
{%- if strategy.hard_deletes == 'new_record' -%}
|
|
210
|
+
, 'False' as {{ columns.dbt_is_deleted }}
|
|
211
|
+
{% endif -%}
|
|
168
212
|
from (
|
|
169
213
|
{{ sql }}
|
|
170
214
|
) sbq
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
{% set columns = config.get("snapshot_table_column_names") or get_snapshot_table_column_names() %}
|
|
39
39
|
|
|
40
|
-
{{ adapter.
|
|
40
|
+
{{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}
|
|
41
41
|
|
|
42
42
|
{% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}
|
|
43
43
|
{% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
{# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}
|
|
55
55
|
{% set primary_key = config.get('unique_key') %}
|
|
56
56
|
{% set updated_at = config.get('updated_at') %}
|
|
57
|
-
{% set
|
|
57
|
+
{% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}
|
|
58
|
+
{% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}
|
|
58
59
|
{% set columns = config.get("snapshot_table_column_names") or get_snapshot_table_column_names() %}
|
|
59
60
|
|
|
60
61
|
{#/*
|
|
@@ -78,7 +79,8 @@
|
|
|
78
79
|
"updated_at": updated_at,
|
|
79
80
|
"row_changed": row_changed_expr,
|
|
80
81
|
"scd_id": scd_id_expr,
|
|
81
|
-
"invalidate_hard_deletes": invalidate_hard_deletes
|
|
82
|
+
"invalidate_hard_deletes": invalidate_hard_deletes,
|
|
83
|
+
"hard_deletes": hard_deletes
|
|
82
84
|
}) %}
|
|
83
85
|
{% endmacro %}
|
|
84
86
|
|
|
@@ -141,7 +143,8 @@
|
|
|
141
143
|
{# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}
|
|
142
144
|
{% set check_cols_config = config.get('check_cols') %}
|
|
143
145
|
{% set primary_key = config.get('unique_key') %}
|
|
144
|
-
{% set
|
|
146
|
+
{% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}
|
|
147
|
+
{% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}
|
|
145
148
|
{% set updated_at = config.get('updated_at') or snapshot_get_time() %}
|
|
146
149
|
|
|
147
150
|
{% set column_added = false %}
|
|
@@ -175,6 +178,7 @@
|
|
|
175
178
|
"updated_at": updated_at,
|
|
176
179
|
"row_changed": row_changed_expr,
|
|
177
180
|
"scd_id": scd_id_expr,
|
|
178
|
-
"invalidate_hard_deletes": invalidate_hard_deletes
|
|
181
|
+
"invalidate_hard_deletes": invalidate_hard_deletes,
|
|
182
|
+
"hard_deletes": hard_deletes
|
|
179
183
|
}) %}
|
|
180
184
|
{% endmacro %}
|
|
@@ -23,12 +23,12 @@ classifiers = [
|
|
|
23
23
|
"Programming Language :: Python :: 3.12",
|
|
24
24
|
]
|
|
25
25
|
dependencies = [
|
|
26
|
-
"dbt-common>=1.
|
|
26
|
+
"dbt-common>=1.13,<2.0",
|
|
27
27
|
"pytz>=2015.7",
|
|
28
28
|
# installed via dbt-common but used directly
|
|
29
29
|
"agate>=1.0,<2.0",
|
|
30
|
-
"mashumaro[msgpack]>=3.
|
|
31
|
-
"protobuf>=
|
|
30
|
+
"mashumaro[msgpack]>=3.9,<3.15",
|
|
31
|
+
"protobuf>=5.0,<6.0",
|
|
32
32
|
"typing-extensions>=4.0,<5.0",
|
|
33
33
|
]
|
|
34
34
|
[project.urls]
|
|
@@ -52,6 +52,7 @@ include = ["dbt/adapters", "dbt/include", "dbt/__init__.py"]
|
|
|
52
52
|
include = ["dbt/adapters", "dbt/include", "dbt/__init__.py"]
|
|
53
53
|
|
|
54
54
|
[tool.hatch.envs.default]
|
|
55
|
+
python = "3.9"
|
|
55
56
|
dependencies = [
|
|
56
57
|
"dbt_common @ git+https://github.com/dbt-labs/dbt-common.git",
|
|
57
58
|
'pre-commit==3.7.0;python_version>="3.9"',
|
|
@@ -64,6 +65,12 @@ dependencies = [
|
|
|
64
65
|
setup = "pre-commit install"
|
|
65
66
|
code-quality = "pre-commit run --all-files"
|
|
66
67
|
unit-tests = "python -m pytest {args:tests/unit}"
|
|
68
|
+
workflow-code-quality = "gh workflow run _code-quality.yml --ref $(git rev-parse --abbrev-ref HEAD) -f branch=$(git rev-parse --abbrev-ref HEAD)"
|
|
69
|
+
workflow-generate-changelog = "gh workflow run _generate-changelog.yml --ref $(git rev-parse --abbrev-ref HEAD) -f package=dbt-adapters -f merge=false -f branch=$(git rev-parse --abbrev-ref HEAD)"
|
|
70
|
+
workflow-publish-pypi = "gh workflow run _publish-pypi.yml --ref $(git rev-parse --abbrev-ref HEAD) -f package=dbt-adapters -f deploy-to=test -f branch=$(git rev-parse --abbrev-ref HEAD)"
|
|
71
|
+
workflow-unit-tests = "gh workflow run _unit-tests.yml --ref $(git rev-parse --abbrev-ref HEAD) -f package=dbt-adapters -f branch=$(git rev-parse --abbrev-ref HEAD)"
|
|
72
|
+
workflow-verify-build = "gh workflow run _verify-build.yml --ref $(git rev-parse --abbrev-ref HEAD) -f package=dbt-adapters -f branch=$(git rev-parse --abbrev-ref HEAD)"
|
|
73
|
+
workflow-publish = "gh workflow run publish.yml --ref $(git rev-parse --abbrev-ref HEAD) -f package=dbt-adapters -f branch=$(git rev-parse --abbrev-ref HEAD) -f deploy-to=test -f pypi-internal=false -f pypi-public=true"
|
|
67
74
|
|
|
68
75
|
[tool.hatch.envs.build]
|
|
69
76
|
detached = true
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "1.11.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/adapters/relation_configs/config_validation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/columns.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/freshness.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/indexes.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/metadata.sql
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/schema.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/adapters/show.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/etc/datetime.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/etc/statement.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/create.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/drop.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/rename.sql
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/replace.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/relations/schema.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/any_value.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/array_append.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/array_concat.sql
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/bool_or.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/cast.sql
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/concat.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/data_types.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/date.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/date_spine.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/date_trunc.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/dateadd.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/datediff.sql
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/except.sql
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/hash.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/intersect.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/last_day.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/length.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/listagg.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/literal.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/position.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/replace.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/right.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/safe_cast.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/macros/utils/split_part.sql
RENAMED
|
File without changes
|
{dbt_adapters-1.11.0 → dbt_adapters-1.12.0}/dbt/include/global_project/tests/generic/builtin.sql
RENAMED
|
File without changes
|
|
File without changes
|