{"action":"created","comment":{"url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/comments/240678020","pull_request_review_id":183763145,"id":240678020,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDY3ODAyMA==","diff_hunk":"@@ -70,6 +72,7 @@ def write_batch(self, stream_buffer):\n                     versions.add(record_version)\n \n                 current_table_schema = self.get_table_schema(cur,\n+                                                             (stream_buffer.stream,),","path":"target_postgres/postgres.py","position":13,"original_position":13,"commit_id":"0bc47903a5d76b0cc1488444efc699928a803685","original_commit_id":"0bc47903a5d76b0cc1488444efc699928a803685","user":{"login":"awm33","id":3846080,"node_id":"MDQ6VXNlcjM4NDYwODA=","avatar_url":"https://avatars0.githubusercontent.com/u/3846080?v=4","gravatar_id":"","url":"https://api.github.com/users/awm33","html_url":"https://github.com/awm33","followers_url":"https://api.github.com/users/awm33/followers","following_url":"https://api.github.com/users/awm33/following{/other_user}","gists_url":"https://api.github.com/users/awm33/gists{/gist_id}","starred_url":"https://api.github.com/users/awm33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awm33/subscriptions","organizations_url":"https://api.github.com/users/awm33/orgs","repos_url":"https://api.github.com/users/awm33/repos","events_url":"https://api.github.com/users/awm33/events{/privacy}","received_events_url":"https://api.github.com/users/awm33/received_events","type":"User","site_admin":false},"body":"@AlexanderMann You can use `[ ]` too for list concatenation, if you want to avoid the dangling `,`","created_at":"2018-12-11T16:12:32Z","updated_at":"2018-12-11T16:13:40Z","html_url":"https://github.com/datamill-co/target-postgres/pull/60#discussion_r240678020","pull_request_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/comments/240678020"},"html":{"href":"https://github.com/datamill-co/target-postgres/pull/60#discussion_r240678020"},"pull_request":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60","id":237006749,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MDA2NzQ5","html_url":"https://github.com/datamill-co/target-postgres/pull/60","diff_url":"https://github.com/datamill-co/target-postgres/pull/60.diff","patch_url":"https://github.com/datamill-co/target-postgres/pull/60.patch","issue_url":"https://api.github.com/repos/datamill-co/target-postgres/issues/60","number":60,"state":"open","locked":false,"title":"Feature/table name normalization","user":{"login":"AlexanderMann","id":3885029,"node_id":"MDQ6VXNlcjM4ODUwMjk=","avatar_url":"https://avatars0.githubusercontent.com/u/3885029?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderMann","html_url":"https://github.com/AlexanderMann","followers_url":"https://api.github.com/users/AlexanderMann/followers","following_url":"https://api.github.com/users/AlexanderMann/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMann/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMann/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMann/orgs","repos_url":"https://api.github.com/users/AlexanderMann/repos","events_url":"https://api.github.com/users/AlexanderMann/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMann/received_events","type":"User","site_admin":false},"body":"# Motivation\r\n\r\nhttps://github.com/datamill-co/target-postgres/pull/57\r\n\r\nHandles table name normalization:\r\n- invalid names get mapped to valid ones\r\n  - handles truncation\r\n- name collisions are dealt with by:\r\n  - truncating\r\n  - appending an incrementing number till no collision is detected\r\n\r\nAfter a table has been mapped, it continues to persist data to the mapped name.\r\n\r\nAll data is stored on the `root_table` so that `activate_version` remains simple. This can easily be documented in `RATIONALIZATIONS.md`.\r\n\r\n## Notes\r\n\r\nDOES NOT handle root table name mapping, but does put in place validation to make sure root table name is able to be persisted.\r\n\r\n## Suggested Musical Pairing\r\n\r\nhttps://soundcloud.com/limes-3/saucin-w-h-e-r-b","created_at":"2018-12-07T22:05:17Z","updated_at":"2018-12-11T16:13:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9e0c555354d6e799338d6e41fa21431934d8f26","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60/commits","review_comments_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60/comments","review_comment_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/comments{/number}","comments_url":"https://api.github.com/repos/datamill-co/target-postgres/issues/60/comments","statuses_url":"https://api.github.com/repos/datamill-co/target-postgres/statuses/0bc47903a5d76b0cc1488444efc699928a803685","head":{"label":"AlexanderMann:feature/table-name-normalization--conflicting","ref":"feature/table-name-normalization--conflicting","sha":"0bc47903a5d76b0cc1488444efc699928a803685","user":{"login":"AlexanderMann","id":3885029,"node_id":"MDQ6VXNlcjM4ODUwMjk=","avatar_url":"https://avatars0.githubusercontent.com/u/3885029?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderMann","html_url":"https://github.com/AlexanderMann","followers_url":"https://api.github.com/users/AlexanderMann/followers","following_url":"https://api.github.com/users/AlexanderMann/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMann/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMann/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMann/orgs","repos_url":"https://api.github.com/users/AlexanderMann/repos","events_url":"https://api.github.com/users/AlexanderMann/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMann/received_events","type":"User","site_admin":false},"repo":{"id":155579934,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1Nzk5MzQ=","name":"target-postgres","full_name":"AlexanderMann/target-postgres","private":false,"owner":{"login":"AlexanderMann","id":3885029,"node_id":"MDQ6VXNlcjM4ODUwMjk=","avatar_url":"https://avatars0.githubusercontent.com/u/3885029?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexanderMann","html_url":"https://github.com/AlexanderMann","followers_url":"https://api.github.com/users/AlexanderMann/followers","following_url":"https://api.github.com/users/AlexanderMann/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderMann/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderMann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderMann/subscriptions","organizations_url":"https://api.github.com/users/AlexanderMann/orgs","repos_url":"https://api.github.com/users/AlexanderMann/repos","events_url":"https://api.github.com/users/AlexanderMann/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderMann/received_events","type":"User","site_admin":false},"html_url":"https://github.com/AlexanderMann/target-postgres","description":"A Singer.io Target for Postgres","fork":true,"url":"https://api.github.com/repos/AlexanderMann/target-postgres","forks_url":"https://api.github.com/repos/AlexanderMann/target-postgres/forks","keys_url":"https://api.github.com/repos/AlexanderMann/target-postgres/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderMann/target-postgres/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderMann/target-postgres/teams","hooks_url":"https://api.github.com/repos/AlexanderMann/target-postgres/hooks","issue_events_url":"https://api.github.com/repos/AlexanderMann/target-postgres/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderMann/target-postgres/events","assignees_url":"https://api.github.com/repos/AlexanderMann/target-postgres/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderMann/target-postgres/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderMann/target-postgres/tags","blobs_url":"https://api.github.com/repos/AlexanderMann/target-postgres/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderMann/target-postgres/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderMann/target-postgres/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderMann/target-postgres/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderMann/target-postgres/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderMann/target-postgres/languages","stargazers_url":"https://api.github.com/repos/AlexanderMann/target-postgres/stargazers","contributors_url":"https://api.github.com/repos/AlexanderMann/target-postgres/contributors","subscribers_url":"https://api.github.com/repos/AlexanderMann/target-postgres/subscribers","subscription_url":"https://api.github.com/repos/AlexanderMann/target-postgres/subscription","commits_url":"https://api.github.com/repos/AlexanderMann/target-postgres/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderMann/target-postgres/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderMann/target-postgres/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderMann/target-postgres/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderMann/target-postgres/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderMann/target-postgres/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderMann/target-postgres/merges","archive_url":"https://api.github.com/repos/AlexanderMann/target-postgres/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderMann/target-postgres/downloads","issues_url":"https://api.github.com/repos/AlexanderMann/target-postgres/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderMann/target-postgres/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderMann/target-postgres/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderMann/target-postgres/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderMann/target-postgres/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderMann/target-postgres/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderMann/target-postgres/deployments","created_at":"2018-10-31T15:24:52Z","updated_at":"2018-12-04T20:36:43Z","pushed_at":"2018-12-11T03:27:43Z","git_url":"git://github.com/AlexanderMann/target-postgres.git","ssh_url":"git@github.com:AlexanderMann/target-postgres.git","clone_url":"https://github.com/AlexanderMann/target-postgres.git","svn_url":"https://github.com/AlexanderMann/target-postgres","homepage":"","size":374,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"datamill-co:master","ref":"master","sha":"0c4cee34fa53df3c228ea93443719e236e6b5a1d","user":{"login":"datamill-co","id":37855644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3ODU1NjQ0","avatar_url":"https://avatars0.githubusercontent.com/u/37855644?v=4","gravatar_id":"","url":"https://api.github.com/users/datamill-co","html_url":"https://github.com/datamill-co","followers_url":"https://api.github.com/users/datamill-co/followers","following_url":"https://api.github.com/users/datamill-co/following{/other_user}","gists_url":"https://api.github.com/users/datamill-co/gists{/gist_id}","starred_url":"https://api.github.com/users/datamill-co/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datamill-co/subscriptions","organizations_url":"https://api.github.com/users/datamill-co/orgs","repos_url":"https://api.github.com/users/datamill-co/repos","events_url":"https://api.github.com/users/datamill-co/events{/privacy}","received_events_url":"https://api.github.com/users/datamill-co/received_events","type":"Organization","site_admin":false},"repo":{"id":124483019,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ0ODMwMTk=","name":"target-postgres","full_name":"datamill-co/target-postgres","private":false,"owner":{"login":"datamill-co","id":37855644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3ODU1NjQ0","avatar_url":"https://avatars0.githubusercontent.com/u/37855644?v=4","gravatar_id":"","url":"https://api.github.com/users/datamill-co","html_url":"https://github.com/datamill-co","followers_url":"https://api.github.com/users/datamill-co/followers","following_url":"https://api.github.com/users/datamill-co/following{/other_user}","gists_url":"https://api.github.com/users/datamill-co/gists{/gist_id}","starred_url":"https://api.github.com/users/datamill-co/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datamill-co/subscriptions","organizations_url":"https://api.github.com/users/datamill-co/orgs","repos_url":"https://api.github.com/users/datamill-co/repos","events_url":"https://api.github.com/users/datamill-co/events{/privacy}","received_events_url":"https://api.github.com/users/datamill-co/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/datamill-co/target-postgres","description":"A Singer.io Target for Postgres","fork":false,"url":"https://api.github.com/repos/datamill-co/target-postgres","forks_url":"https://api.github.com/repos/datamill-co/target-postgres/forks","keys_url":"https://api.github.com/repos/datamill-co/target-postgres/keys{/key_id}","collaborators_url":"https://api.github.com/repos/datamill-co/target-postgres/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/datamill-co/target-postgres/teams","hooks_url":"https://api.github.com/repos/datamill-co/target-postgres/hooks","issue_events_url":"https://api.github.com/repos/datamill-co/target-postgres/issues/events{/number}","events_url":"https://api.github.com/repos/datamill-co/target-postgres/events","assignees_url":"https://api.github.com/repos/datamill-co/target-postgres/assignees{/user}","branches_url":"https://api.github.com/repos/datamill-co/target-postgres/branches{/branch}","tags_url":"https://api.github.com/repos/datamill-co/target-postgres/tags","blobs_url":"https://api.github.com/repos/datamill-co/target-postgres/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/datamill-co/target-postgres/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/datamill-co/target-postgres/git/refs{/sha}","trees_url":"https://api.github.com/repos/datamill-co/target-postgres/git/trees{/sha}","statuses_url":"https://api.github.com/repos/datamill-co/target-postgres/statuses/{sha}","languages_url":"https://api.github.com/repos/datamill-co/target-postgres/languages","stargazers_url":"https://api.github.com/repos/datamill-co/target-postgres/stargazers","contributors_url":"https://api.github.com/repos/datamill-co/target-postgres/contributors","subscribers_url":"https://api.github.com/repos/datamill-co/target-postgres/subscribers","subscription_url":"https://api.github.com/repos/datamill-co/target-postgres/subscription","commits_url":"https://api.github.com/repos/datamill-co/target-postgres/commits{/sha}","git_commits_url":"https://api.github.com/repos/datamill-co/target-postgres/git/commits{/sha}","comments_url":"https://api.github.com/repos/datamill-co/target-postgres/comments{/number}","issue_comment_url":"https://api.github.com/repos/datamill-co/target-postgres/issues/comments{/number}","contents_url":"https://api.github.com/repos/datamill-co/target-postgres/contents/{+path}","compare_url":"https://api.github.com/repos/datamill-co/target-postgres/compare/{base}...{head}","merges_url":"https://api.github.com/repos/datamill-co/target-postgres/merges","archive_url":"https://api.github.com/repos/datamill-co/target-postgres/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/datamill-co/target-postgres/downloads","issues_url":"https://api.github.com/repos/datamill-co/target-postgres/issues{/number}","pulls_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls{/number}","milestones_url":"https://api.github.com/repos/datamill-co/target-postgres/milestones{/number}","notifications_url":"https://api.github.com/repos/datamill-co/target-postgres/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/datamill-co/target-postgres/labels{/name}","releases_url":"https://api.github.com/repos/datamill-co/target-postgres/releases{/id}","deployments_url":"https://api.github.com/repos/datamill-co/target-postgres/deployments","created_at":"2018-03-09T03:34:12Z","updated_at":"2018-12-04T21:17:19Z","pushed_at":"2018-12-11T03:27:45Z","git_url":"git://github.com/datamill-co/target-postgres.git","ssh_url":"git@github.com:datamill-co/target-postgres.git","clone_url":"https://github.com/datamill-co/target-postgres.git","svn_url":"https://github.com/datamill-co/target-postgres","homepage":"","size":273,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":4,"open_issues":14,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60"},"html":{"href":"https://github.com/datamill-co/target-postgres/pull/60"},"issue":{"href":"https://api.github.com/repos/datamill-co/target-postgres/issues/60"},"comments":{"href":"https://api.github.com/repos/datamill-co/target-postgres/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/datamill-co/target-postgres/statuses/0bc47903a5d76b0cc1488444efc699928a803685"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"awm33"}}