Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Data Engineers Snowflake DataOps Utils Project Changelog
This file contains the changelog for the Data Engineers Snowflake DataOps Utils project, detailing updates, fixes, and enhancements made to the project over time.

## v1.0.8 - 2026-06-25 - Grant SQL Quoting Fix

### Fixed
- Fixed SQL compilation error in grant macros caused by `tojson` Jinja filter producing double-quoted strings (`"ROLE_NAME"`) which Snowflake interprets as identifiers instead of string literals. Replaced with `format("'%s'")` to produce correct single-quoted SQL strings (`'ROLE_NAME'`). Affected macros: `grant_schema_read`, `grant_schema_object_privileges`, and `_grants_get_schema_object_privs`.

### Changed
- Bumped version from 1.0.7 to 1.0.8

## v1.0.7 - 2026-06-25 - Grant Performance Optimization

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A macro-only [dbt](https://github.com/dbt-labs/dbt) package for Snowflake DataOps. Provides utilities for object lifecycle management, RBAC grant orchestration, dimensional modelling helpers, tagging, shares, and more.

- **Version**: 1.0.7
- **Version**: 1.0.8
- **dbt**: `>=1.3.0, <3.0.0`
- **Dependencies**: None (zero external package dependencies)
- **dbt Fusion**: Compatible
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'dbt_dataengineers_utils'
version: '1.0.7'
version: '1.0.8'
config-version: 2

require-dbt-version: [">=1.9.4", "<3.0.0"]
Expand Down
4 changes: 2 additions & 2 deletions macros/grants/_helpers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ These ideas intentionally deferred to keep current refactor incremental.
from information_schema.object_privileges
where object_schema = '{{ schema }}'
{% if priv_filter | length > 0 %}
and privilege_type in ({{ priv_filter | map('tojson') | join(', ') }})
and privilege_type in ({{ priv_filter | map("format", "'%s'") | join(', ') }})
{% endif %}
{% if grantees_upper | length > 0 %}
and grantee in ({{ grantees_upper | map('tojson') | join(', ') }})
and grantee in ({{ grantees_upper | map("format", "'%s'") | join(', ') }})
{% endif %}
{% if object_type is not none %}
and object_type = '{{ object_type | upper }}'
Expand Down
4 changes: 2 additions & 2 deletions macros/grants/grant_schema_object_privileges.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
select distinct privilege_type, grantee
from information_schema.object_privileges
where object_schema = '{{ schema_name }}'
and privilege_type in ({{ permission_list | map('upper') | map('tojson') | join(', ') }})
and grantee not in ({{ role_list | map('tojson') | join(', ') }})
and privilege_type in ({{ permission_list | map('upper') | map("format", "'%s'") | join(', ') }})
and grantee not in ({{ role_list | map("format", "'%s'") | join(', ') }})
and object_type = '{{ object_type | upper }}'
and grantor is not null
{% endset %}
Expand Down
2 changes: 1 addition & 1 deletion macros/grants/grant_schema_read.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
and table_privileges.table_catalog = tables.table_catalog
where tables.table_schema = '{{ schema }}'
and table_privileges.privilege_type in ('SELECT','REFERENCES','REBUILD')
and table_privileges.grantee not in ({{ grant_roles | map('tojson') | join(', ') }})
and table_privileges.grantee not in ({{ grant_roles | map("format", "'%s'") | join(', ') }})
and granted_to = 'ROLE'
{% endset %}
{% set tbl_privs = run_query(revoke_query) %}
Expand Down
Loading