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

Example for this using post-hook seems to be overwritten on load, leaving a confusing replacement #3359

Closed
1 task done
KennyShaevelA8 opened this issue May 10, 2023 · 0 comments · Fixed by #6592
Closed
1 task done
Labels
engineering improvement that requires site engineering help or back up

Comments

@KennyShaevelA8
Copy link

Contributions

  • I have read the contribution docs, and understand what's expected of me.

What page(s) or areas on docs.getdbt.com are affected?

https://docs.getdbt.com/reference/dbt-jinja-functions/this#examples

https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/dbt-jinja-functions/this.md

What changes are you suggesting?

The examples section of the "About this" docs page opens with a paragraph about using grants instead of post-hook without any context as to why it brings this up.

In older versions of dbt, the most common use of post-hook was to execute grant statements, to apply database permissions to models right after creating them. Starting in v1.2, we recommend using the grants resource config instead, in order to automatically apply grants when your dbt model runs.

I figured this was perhaps pasted into the doc in error, so I went to edit the page to remove it, only to find the source includes a perfectly comprehensible example that happens to use a post-hook.

<Snippet src="hooks-to-grants" />

<VersionBlock lastVersion="1.1">

### Grant permissions on a model in a post-hook

<File name='dbt_project.yml'>

```yaml
models:
  project-name:
    +post-hook:
      - "grant select on {{ this }} to db_reader"
```

</File>

</VersionBlock>

I am not sure exactly why/how this snippet is being overwritten when the page is loaded, but the result a bit bewildering. I feel either the example should be displayed as-is or removed from the page. Thanks!

Additional information

No response

@KennyShaevelA8 KennyShaevelA8 added the engineering improvement that requires site engineering help or back up label May 10, 2023
@matthewshaver matthewshaver mentioned this issue Dec 4, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering improvement that requires site engineering help or back up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant