Skip to content

feat: add snowflake grant support#5433

Merged
eakmanrq merged 1 commit intoddai/grantsfrom
eakmanrq/snow_grants
Sep 24, 2025
Merged

feat: add snowflake grant support#5433
eakmanrq merged 1 commit intoddai/grantsfrom
eakmanrq/snow_grants

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Sep 23, 2025

Adds support for Grants to Snowflake.

Also includes moving engine-adapter tests that should run for all engines that support grant to the test_integration.py folder and updating it to use patterns that are expected in that file (like creating test-specific objects instead of shared global objects).

@eakmanrq eakmanrq force-pushed the eakmanrq/snow_grants branch 2 times, most recently from 755f12f to aaed6fc Compare September 23, 2025 21:08
@eakmanrq eakmanrq marked this pull request as ready for review September 23, 2025 21:51
@eakmanrq eakmanrq force-pushed the eakmanrq/snow_grants branch 2 times, most recently from 969840b to 6dc6530 Compare September 23, 2025 21:57
@eakmanrq eakmanrq requested a review from Copilot September 23, 2025 21:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive grants support for Snowflake engine adapter, enabling database-level permission management through SQLMesh. The feature includes methods to sync grants configuration with the database, supporting common privileges like SELECT, INSERT, UPDATE for roles and users.

  • Implements grants functionality for Snowflake engine adapter with sync and query methods
  • Adds comprehensive test coverage for grants operations including edge cases
  • Refactors integration tests to use shared grants testing utilities

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sqlmesh/core/engine_adapter/snowflake.py Core implementation of grants support with sync and query methods
sqlmesh/core/engine_adapter/postgres.py Minor type annotation fix for MAX_IDENTIFIER_LENGTH
sqlmesh/core/engine_adapter/risingwave.py Explicitly disables grants support
sqlmesh/core/engine_adapter/_typing.py Adds DCL type variable for grant/revoke operations
tests/core/engine_adapter/test_snowflake.py Extensive unit tests for Snowflake grants functionality
tests/core/engine_adapter/integration/init.py Shared utilities for creating users/roles in integration tests
tests/core/engine_adapter/integration/test_integration.py Generic grants integration tests
tests/core/engine_adapter/integration/test_integration_postgres.py Refactored to use shared test utilities
.circleci/continue_config.yml Temporary CI configuration changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@eakmanrq eakmanrq force-pushed the eakmanrq/snow_grants branch from 6dc6530 to 50a903c Compare September 23, 2025 22:44
@newtonapple newtonapple force-pushed the ddai/grants branch 2 times, most recently from ea30878 to 2f3b72a Compare September 23, 2025 23:03
@eakmanrq eakmanrq force-pushed the eakmanrq/snow_grants branch from 50a903c to 4041549 Compare September 23, 2025 23:10
@eakmanrq eakmanrq merged commit ca03fcf into ddai/grants Sep 24, 2025
14 of 21 checks passed
@eakmanrq eakmanrq deleted the eakmanrq/snow_grants branch September 24, 2025 02:14
newtonapple pushed a commit that referenced this pull request Sep 29, 2025
newtonapple pushed a commit that referenced this pull request Sep 30, 2025
newtonapple pushed a commit that referenced this pull request Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants