{"action":"closed","number":147,"pull_request":{"url":"https://api.github.com/repos/analyst-collective/dbt/pulls/147","id":85617504,"html_url":"https://github.com/analyst-collective/dbt/pull/147","diff_url":"https://github.com/analyst-collective/dbt/pull/147.diff","patch_url":"https://github.com/analyst-collective/dbt/pull/147.patch","issue_url":"https://api.github.com/repos/analyst-collective/dbt/issues/147","number":147,"state":"closed","locked":false,"title":"Feature/simple hooks","user":{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false},"body":"Implements the simple version of hooks. In your `dbt_project.yml` file:\r\n\r\n```yaml\r\nmodels:\r\n  'Test DBT':\r\n    pre-hook: \"insert into {{ ref('audit') }} (model, timestamp, status) values ('{{this.table}}', getdate(), 'started')\"\r\n    post-hook:\r\n       - \"insert into {{ ref('audit') }} (model, timestamp, status) values ('{{this.table}}', getdate(), 'completed')\"\r\n       - \"grant select on {{this}} to some_user\"\r\n```\r\n\r\nThere are a couple of new things here:\r\n - pre hooks run _before_ a model is executed\r\n - post hooks run _after_ a model is executed\r\n - hooks can be defined as either a string, or a list of strings\r\n - these hooks are a part of the transaction which materializes a model. If the transaction fails, the hooks will not be run.\r\n - the `{{ this }}` var has been extended such that you can use\r\n  - `{{this}}` to interpolate `\"schema\".\"table\"`\r\n  - `{{this.schema}}` to interpolate `\"schema\"`\r\n  - `{{this.table}}` to interpolate `\"table\"`\r\n - hooks are _appended_ to child configs. A hook defined directly beneath the project config will be applied to every model in that project. Hooks defined more specifically will be augmented, not overwritten.\r\n - hooks are not applied to ephemeral models\r\n\r\ncc @jthandy ","created_at":"2016-09-16T18:21:06Z","updated_at":"2016-09-19T17:39:27Z","closed_at":"2016-09-19T17:39:27Z","merged_at":"2016-09-19T17:39:27Z","merge_commit_sha":"8d9bd1850e476ef11251d0660d33a6b35edb40f8","assignee":{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false},"assignees":[{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/analyst-collective/dbt/milestones/6","html_url":"https://github.com/analyst-collective/dbt/milestones/0.4.2","labels_url":"https://api.github.com/repos/analyst-collective/dbt/milestones/6/labels","id":1954177,"number":6,"title":"0.4.2","description":"","creator":{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":1,"state":"open","created_at":"2016-08-22T04:50:32Z","updated_at":"2016-09-19T17:39:27Z","due_on":"2016-09-04T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/analyst-collective/dbt/pulls/147/commits","review_comments_url":"https://api.github.com/repos/analyst-collective/dbt/pulls/147/comments","review_comment_url":"https://api.github.com/repos/analyst-collective/dbt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/analyst-collective/dbt/issues/147/comments","statuses_url":"https://api.github.com/repos/analyst-collective/dbt/statuses/1ccde80b8bced6480a34713bd2953d5bf92ddf7b","head":{"label":"analyst-collective:feature/simple-hooks","ref":"feature/simple-hooks","sha":"1ccde80b8bced6480a34713bd2953d5bf92ddf7b","user":{"login":"analyst-collective","id":17324116,"avatar_url":"https://avatars.githubusercontent.com/u/17324116?v=3","gravatar_id":"","url":"https://api.github.com/users/analyst-collective","html_url":"https://github.com/analyst-collective","followers_url":"https://api.github.com/users/analyst-collective/followers","following_url":"https://api.github.com/users/analyst-collective/following{/other_user}","gists_url":"https://api.github.com/users/analyst-collective/gists{/gist_id}","starred_url":"https://api.github.com/users/analyst-collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analyst-collective/subscriptions","organizations_url":"https://api.github.com/users/analyst-collective/orgs","repos_url":"https://api.github.com/users/analyst-collective/repos","events_url":"https://api.github.com/users/analyst-collective/events{/privacy}","received_events_url":"https://api.github.com/users/analyst-collective/received_events","type":"Organization","site_admin":false},"repo":{"id":53548867,"name":"dbt","full_name":"analyst-collective/dbt","owner":{"login":"analyst-collective","id":17324116,"avatar_url":"https://avatars.githubusercontent.com/u/17324116?v=3","gravatar_id":"","url":"https://api.github.com/users/analyst-collective","html_url":"https://github.com/analyst-collective","followers_url":"https://api.github.com/users/analyst-collective/followers","following_url":"https://api.github.com/users/analyst-collective/following{/other_user}","gists_url":"https://api.github.com/users/analyst-collective/gists{/gist_id}","starred_url":"https://api.github.com/users/analyst-collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analyst-collective/subscriptions","organizations_url":"https://api.github.com/users/analyst-collective/orgs","repos_url":"https://api.github.com/users/analyst-collective/repos","events_url":"https://api.github.com/users/analyst-collective/events{/privacy}","received_events_url":"https://api.github.com/users/analyst-collective/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/analyst-collective/dbt","description":"Data build tool.","fork":false,"url":"https://api.github.com/repos/analyst-collective/dbt","forks_url":"https://api.github.com/repos/analyst-collective/dbt/forks","keys_url":"https://api.github.com/repos/analyst-collective/dbt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/analyst-collective/dbt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/analyst-collective/dbt/teams","hooks_url":"https://api.github.com/repos/analyst-collective/dbt/hooks","issue_events_url":"https://api.github.com/repos/analyst-collective/dbt/issues/events{/number}","events_url":"https://api.github.com/repos/analyst-collective/dbt/events","assignees_url":"https://api.github.com/repos/analyst-collective/dbt/assignees{/user}","branches_url":"https://api.github.com/repos/analyst-collective/dbt/branches{/branch}","tags_url":"https://api.github.com/repos/analyst-collective/dbt/tags","blobs_url":"https://api.github.com/repos/analyst-collective/dbt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/analyst-collective/dbt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/analyst-collective/dbt/git/refs{/sha}","trees_url":"https://api.github.com/repos/analyst-collective/dbt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/analyst-collective/dbt/statuses/{sha}","languages_url":"https://api.github.com/repos/analyst-collective/dbt/languages","stargazers_url":"https://api.github.com/repos/analyst-collective/dbt/stargazers","contributors_url":"https://api.github.com/repos/analyst-collective/dbt/contributors","subscribers_url":"https://api.github.com/repos/analyst-collective/dbt/subscribers","subscription_url":"https://api.github.com/repos/analyst-collective/dbt/subscription","commits_url":"https://api.github.com/repos/analyst-collective/dbt/commits{/sha}","git_commits_url":"https://api.github.com/repos/analyst-collective/dbt/git/commits{/sha}","comments_url":"https://api.github.com/repos/analyst-collective/dbt/comments{/number}","issue_comment_url":"https://api.github.com/repos/analyst-collective/dbt/issues/comments{/number}","contents_url":"https://api.github.com/repos/analyst-collective/dbt/contents/{+path}","compare_url":"https://api.github.com/repos/analyst-collective/dbt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/analyst-collective/dbt/merges","archive_url":"https://api.github.com/repos/analyst-collective/dbt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/analyst-collective/dbt/downloads","issues_url":"https://api.github.com/repos/analyst-collective/dbt/issues{/number}","pulls_url":"https://api.github.com/repos/analyst-collective/dbt/pulls{/number}","milestones_url":"https://api.github.com/repos/analyst-collective/dbt/milestones{/number}","notifications_url":"https://api.github.com/repos/analyst-collective/dbt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/analyst-collective/dbt/labels{/name}","releases_url":"https://api.github.com/repos/analyst-collective/dbt/releases{/id}","deployments_url":"https://api.github.com/repos/analyst-collective/dbt/deployments","created_at":"2016-03-10T02:38:00Z","updated_at":"2016-09-18T00:14:41Z","pushed_at":"2016-09-19T17:39:27Z","git_url":"git://github.com/analyst-collective/dbt.git","ssh_url":"git@github.com:analyst-collective/dbt.git","clone_url":"https://github.com/analyst-collective/dbt.git","svn_url":"https://github.com/analyst-collective/dbt","homepage":"","size":335,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":44,"forks":4,"open_issues":44,"watchers":21,"default_branch":"development"}},"base":{"label":"analyst-collective:development","ref":"development","sha":"00eaad04a2785c4d3f5a60832a2122bc3e1519ed","user":{"login":"analyst-collective","id":17324116,"avatar_url":"https://avatars.githubusercontent.com/u/17324116?v=3","gravatar_id":"","url":"https://api.github.com/users/analyst-collective","html_url":"https://github.com/analyst-collective","followers_url":"https://api.github.com/users/analyst-collective/followers","following_url":"https://api.github.com/users/analyst-collective/following{/other_user}","gists_url":"https://api.github.com/users/analyst-collective/gists{/gist_id}","starred_url":"https://api.github.com/users/analyst-collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analyst-collective/subscriptions","organizations_url":"https://api.github.com/users/analyst-collective/orgs","repos_url":"https://api.github.com/users/analyst-collective/repos","events_url":"https://api.github.com/users/analyst-collective/events{/privacy}","received_events_url":"https://api.github.com/users/analyst-collective/received_events","type":"Organization","site_admin":false},"repo":{"id":53548867,"name":"dbt","full_name":"analyst-collective/dbt","owner":{"login":"analyst-collective","id":17324116,"avatar_url":"https://avatars.githubusercontent.com/u/17324116?v=3","gravatar_id":"","url":"https://api.github.com/users/analyst-collective","html_url":"https://github.com/analyst-collective","followers_url":"https://api.github.com/users/analyst-collective/followers","following_url":"https://api.github.com/users/analyst-collective/following{/other_user}","gists_url":"https://api.github.com/users/analyst-collective/gists{/gist_id}","starred_url":"https://api.github.com/users/analyst-collective/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analyst-collective/subscriptions","organizations_url":"https://api.github.com/users/analyst-collective/orgs","repos_url":"https://api.github.com/users/analyst-collective/repos","events_url":"https://api.github.com/users/analyst-collective/events{/privacy}","received_events_url":"https://api.github.com/users/analyst-collective/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/analyst-collective/dbt","description":"Data build tool.","fork":false,"url":"https://api.github.com/repos/analyst-collective/dbt","forks_url":"https://api.github.com/repos/analyst-collective/dbt/forks","keys_url":"https://api.github.com/repos/analyst-collective/dbt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/analyst-collective/dbt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/analyst-collective/dbt/teams","hooks_url":"https://api.github.com/repos/analyst-collective/dbt/hooks","issue_events_url":"https://api.github.com/repos/analyst-collective/dbt/issues/events{/number}","events_url":"https://api.github.com/repos/analyst-collective/dbt/events","assignees_url":"https://api.github.com/repos/analyst-collective/dbt/assignees{/user}","branches_url":"https://api.github.com/repos/analyst-collective/dbt/branches{/branch}","tags_url":"https://api.github.com/repos/analyst-collective/dbt/tags","blobs_url":"https://api.github.com/repos/analyst-collective/dbt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/analyst-collective/dbt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/analyst-collective/dbt/git/refs{/sha}","trees_url":"https://api.github.com/repos/analyst-collective/dbt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/analyst-collective/dbt/statuses/{sha}","languages_url":"https://api.github.com/repos/analyst-collective/dbt/languages","stargazers_url":"https://api.github.com/repos/analyst-collective/dbt/stargazers","contributors_url":"https://api.github.com/repos/analyst-collective/dbt/contributors","subscribers_url":"https://api.github.com/repos/analyst-collective/dbt/subscribers","subscription_url":"https://api.github.com/repos/analyst-collective/dbt/subscription","commits_url":"https://api.github.com/repos/analyst-collective/dbt/commits{/sha}","git_commits_url":"https://api.github.com/repos/analyst-collective/dbt/git/commits{/sha}","comments_url":"https://api.github.com/repos/analyst-collective/dbt/comments{/number}","issue_comment_url":"https://api.github.com/repos/analyst-collective/dbt/issues/comments{/number}","contents_url":"https://api.github.com/repos/analyst-collective/dbt/contents/{+path}","compare_url":"https://api.github.com/repos/analyst-collective/dbt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/analyst-collective/dbt/merges","archive_url":"https://api.github.com/repos/analyst-collective/dbt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/analyst-collective/dbt/downloads","issues_url":"https://api.github.com/repos/analyst-collective/dbt/issues{/number}","pulls_url":"https://api.github.com/repos/analyst-collective/dbt/pulls{/number}","milestones_url":"https://api.github.com/repos/analyst-collective/dbt/milestones{/number}","notifications_url":"https://api.github.com/repos/analyst-collective/dbt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/analyst-collective/dbt/labels{/name}","releases_url":"https://api.github.com/repos/analyst-collective/dbt/releases{/id}","deployments_url":"https://api.github.com/repos/analyst-collective/dbt/deployments","created_at":"2016-03-10T02:38:00Z","updated_at":"2016-09-18T00:14:41Z","pushed_at":"2016-09-19T17:39:27Z","git_url":"git://github.com/analyst-collective/dbt.git","ssh_url":"git@github.com:analyst-collective/dbt.git","clone_url":"https://github.com/analyst-collective/dbt.git","svn_url":"https://github.com/analyst-collective/dbt","homepage":"","size":335,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":44,"forks":4,"open_issues":44,"watchers":21,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/analyst-collective/dbt/pulls/147"},"html":{"href":"https://github.com/analyst-collective/dbt/pull/147"},"issue":{"href":"https://api.github.com/repos/analyst-collective/dbt/issues/147"},"comments":{"href":"https://api.github.com/repos/analyst-collective/dbt/issues/147/comments"},"review_comments":{"href":"https://api.github.com/repos/analyst-collective/dbt/pulls/147/comments"},"review_comment":{"href":"https://api.github.com/repos/analyst-collective/dbt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/analyst-collective/dbt/pulls/147/commits"},"statuses":{"href":"https://api.github.com/repos/analyst-collective/dbt/statuses/1ccde80b8bced6480a34713bd2953d5bf92ddf7b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"drewbanin","id":1541139,"avatar_url":"https://avatars.githubusercontent.com/u/1541139?v=3","gravatar_id":"","url":"https://api.github.com/users/drewbanin","html_url":"https://github.com/drewbanin","followers_url":"https://api.github.com/users/drewbanin/followers","following_url":"https://api.github.com/users/drewbanin/following{/other_user}","gists_url":"https://api.github.com/users/drewbanin/gists{/gist_id}","starred_url":"https://api.github.com/users/drewbanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewbanin/subscriptions","organizations_url":"https://api.github.com/users/drewbanin/orgs","repos_url":"https://api.github.com/users/drewbanin/repos","events_url":"https://api.github.com/users/drewbanin/events{/privacy}","received_events_url":"https://api.github.com/users/drewbanin/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":3,"additions":78,"deletions":9,"changed_files":4}}
{"actor":{"display_login":"drewbanin"}}