{"action":"created","comment":{"url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/comments/236701909","pull_request_review_id":178829748,"id":236701909,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjcwMTkwOQ==","diff_hunk":"@@ -407,93 +306,84 @@ def get_update_sql(self, target_table_name, temp_table_name, key_properties, sub\n                         insert_distinct_on=insert_distinct_on,\n                         insert_distinct_order_by=insert_distinct_order_by)\n \n-    def persist_rows(self,\n-                     cur,\n-                     target_table_name,\n-                     temp_table_name,\n-                     remote_schema,\n-                     streamed_json_schema,\n-                     key_properties,\n-                     records):\n-        headers = list(remote_schema['schema']['properties'].keys())\n-\n-        datetime_fields = [k for k,v in streamed_json_schema['schema']['properties'].items()\n-                           if v.get('format') == 'date-time']\n-\n-        default_fields = {k: v.get('default') for k, v in streamed_json_schema['schema']['properties'].items()\n-                          if v.get('default') is not None}\n-\n-        fields = set(headers +\n-                     [v['from'] for k, v in remote_schema.get('mappings', {}).items()])\n+    def parse_table_record_serialize_field_name(self, remote_schema, streamed_schema, field, value):","path":"target_postgres/postgres.py","position":233,"original_position":233,"commit_id":"89bc9d20040feb54ba65339ea46d7849696bc247","original_commit_id":"89bc9d20040feb54ba65339ea46d7849696bc247","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're using the word \"parse\" a lot. Whenever I see that in code I take it as meaning interpreting / deserializing something from a string. I realize the that's not the only use of the word parse, and context can help, but I think it's losing exact meaning in here.","created_at":"2018-11-27T15:02:23Z","updated_at":"2018-11-27T15:05:28Z","html_url":"https://github.com/datamill-co/target-postgres/pull/43#discussion_r236701909","pull_request_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/comments/236701909"},"html":{"href":"https://github.com/datamill-co/target-postgres/pull/43#discussion_r236701909"},"pull_request":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43","id":233729284,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNzI5Mjg0","html_url":"https://github.com/datamill-co/target-postgres/pull/43","diff_url":"https://github.com/datamill-co/target-postgres/pull/43.diff","patch_url":"https://github.com/datamill-co/target-postgres/pull/43.patch","issue_url":"https://api.github.com/repos/datamill-co/target-postgres/issues/43","number":43,"state":"open","locked":false,"title":"Refactor/sql persist","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\nhttps://github.com/datamill-co/target-postgres/projects/1#card-14578993\r\n\r\nFollow up to the work done in #41. This PR seeks to start tackling the commonality of `write_batch` for `SQLInterface`.\r\n\r\n## Notes\r\nThis pr moves the following functionality over to `sql_base`:\r\n- records denesting per table\r\n- records serialization preparation for remote persistence\r\n\r\nThis pr _removes_ the following functionality from `sql_base`:\r\n- bulk/entire schema updating for remote\r\n  - it leaves in place updating _individual_ tables\r\n\r\n## Suggested Musical Pairing\r\nhttps://soundcloud.com/subpop/rolling-blackouts-julies-place","created_at":"2018-11-26T23:22:10Z","updated_at":"2018-11-27T15:05:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70522d952644a527e7e679cbde6e6eaf70d65331","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43/commits","review_comments_url":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43/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/43/comments","statuses_url":"https://api.github.com/repos/datamill-co/target-postgres/statuses/89bc9d20040feb54ba65339ea46d7849696bc247","head":{"label":"AlexanderMann:refactor/sql-persist","ref":"refactor/sql-persist","sha":"89bc9d20040feb54ba65339ea46d7849696bc247","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-11-26T15:31:41Z","pushed_at":"2018-11-27T14:02:40Z","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":178,"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":"669b8be93fb274bb109381855e325ccd567a828f","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-11-26T15:28:47Z","pushed_at":"2018-11-27T14:02:42Z","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":201,"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":11,"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":11,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43"},"html":{"href":"https://github.com/datamill-co/target-postgres/pull/43"},"issue":{"href":"https://api.github.com/repos/datamill-co/target-postgres/issues/43"},"comments":{"href":"https://api.github.com/repos/datamill-co/target-postgres/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/datamill-co/target-postgres/pulls/43/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/43/commits"},"statuses":{"href":"https://api.github.com/repos/datamill-co/target-postgres/statuses/89bc9d20040feb54ba65339ea46d7849696bc247"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"awm33"}}