Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Future grants to database roles are re-applied all the time #182

Open
mlavaert opened this issue Dec 23, 2024 · 0 comments
Open

[BUG] Future grants to database roles are re-applied all the time #182

mlavaert opened this issue Dec 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mlavaert
Copy link
Contributor

Something goes wrong fetching existing future grants to database roles. I've done a bit of debugging but failed to figure it out.

The problem starts here in data_provider.py in the fetch_future_grant function:

  grants = _filter_result(
      show_result,
      privilege=fqn.params["priv"],
      name=collection_str,
      grant_to=str(to_type),
      grantee_name=to,
  )

  if len(grants) == 0:
      return None
  elif len(grants) > 1:
      raise Exception(f"Found multiple future grants matching {fqn}")

str(to_type) will return DATABASE ROLE but the query in Snowflake uses DATABASE_ROLE in the result.
to uses the full FQN including the database name of the database role. Snowflake uses just the name of the database role.

@teej teej added the bug Something isn't working label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants