athena: extend Lake Formation tagging and data filters #1439
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.
Problem
dbt-athenais missing several Lake Formation capabilities that exist in thedbt-glueadapter (database-level tags, better data cell filter controls, more flexible behavior for tag/filter removal).all_rows, column include/exclude patterns, or a non-destructive mode.AthenaAdapter.dbt-athena/tests/functional/adapter/test_sample_mode.py:40.Solution
Lake Formation tags
lf_tags_configwith:drop_existing(defaultfalse) to choose between additive vs authoritative tag management.tags_databasefor database-level tags.inherited_tags(clarified) to protect inherited keys from removal whendrop_existing: true.drop_existing: true(respectinginherited_tags).drop_existing: false.Data cell filters (
lf_grants)data_cell_filterswith:drop_existing(defaultfalse) to control whether filters missing from config are deleted.row_filterorall_rows: true.column_namesorexcluded_column_names(omit both for all columns).row_filter/all_rowscombinations fail fast.Adapter / tests
dbt-athena/src/dbt/adapters/athena/impl.py:_CATALOG_TEXT_COLUMNSand_catalog_filter_tableusing_catalog_filter_schemasto address unit-test warnings around catalog filtering and text-only columns.nowtodatetime.datetime.now(datetime.timezone.utc)in:dbt-athena/tests/functional/adapter/test_sample_mode.pydbt-bigquery/tests/functional/adapter/test_sample_mode.pydbt-athena/tests/functional/adapter/test_sample_mode.py:40caused by naive vs timezone-aware datetime comparisons.FilterConfigvalidation, API representation, and update detection.Checklist