{"action":"created","issue":{"url":"https://api.github.com/repos/uber/vertica-python/issues/119","repository_url":"https://api.github.com/repos/uber/vertica-python","labels_url":"https://api.github.com/repos/uber/vertica-python/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/uber/vertica-python/issues/119/comments","events_url":"https://api.github.com/repos/uber/vertica-python/issues/119/events","html_url":"https://github.com/uber/vertica-python/pull/119","id":154976351,"number":119,"title":"fixed parsing of Timestamp and TimestampTz columns in Python3","user":{"login":"dennisobrien","id":1168692,"avatar_url":"https://avatars.githubusercontent.com/u/1168692?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisobrien","html_url":"https://github.com/dennisobrien","followers_url":"https://api.github.com/users/dennisobrien/followers","following_url":"https://api.github.com/users/dennisobrien/following{/other_user}","gists_url":"https://api.github.com/users/dennisobrien/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisobrien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisobrien/subscriptions","organizations_url":"https://api.github.com/users/dennisobrien/orgs","repos_url":"https://api.github.com/users/dennisobrien/repos","events_url":"https://api.github.com/users/dennisobrien/events{/privacy}","received_events_url":"https://api.github.com/users/dennisobrien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-16T07:32:44Z","updated_at":"2016-05-16T07:34:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/uber/vertica-python/pulls/119","html_url":"https://github.com/uber/vertica-python/pull/119","diff_url":"https://github.com/uber/vertica-python/pull/119.diff","patch_url":"https://github.com/uber/vertica-python/pull/119.patch"},"body":"This modifies `timestamp_parse` and `timestamp_tz_parse` to coerce the argument to a utf-8 encode string.  In Python2 the argument is already a string while in Python3 it is a bytes object.\r\n\r\nThese three queries threw exceptions that are fixed by this PR:\r\n```\r\nconnection = vertica_python.connect(**config)\r\ncursor = connection.cursor()\r\n\r\n# calls timestamp_parse\r\nquery = \"\"\"\r\nselect\r\n  to_timestamp('2016-05-15 13:15:17.789', 'YYYY-MM-DD HH:MI:SS.MS')\r\n;\r\n\"\"\"\r\ncursor.execute(query)\r\ncursor.fetchall()\r\n\r\n# calls timestamp_tz_parse\r\nquery = \"\"\"\r\nselect\r\n  to_timestamp_tz('2016-05-15 13:15:17.789 UTC', 'YYYY-MM-DD HH:MI:SS.MS TZ')\r\n;\r\n\"\"\"\r\ncursor.execute(query)\r\ncursor.fetchall()\r\n\r\n# calls timestamp_tz_parse\r\nquery = \"\"\"\r\nselect\r\n  timestamp '2016-05-15 13:15:17.789+00'\r\n;\r\n\"\"\"\r\ncursor.execute(query)\r\ncursor.fetchall()\r\n```\r\n\r\nIt may be that we should be coercing to unicode somewhere before the parse methods are called.  Let me know if that is the case and I can move it sooner in the pipeline.\r\n\r\nthanks,\r\nDennis"},"comment":{"url":"https://api.github.com/repos/uber/vertica-python/issues/comments/219366584","html_url":"https://github.com/uber/vertica-python/pull/119#issuecomment-219366584","issue_url":"https://api.github.com/repos/uber/vertica-python/issues/119","id":219366584,"user":{"login":"dennisobrien","id":1168692,"avatar_url":"https://avatars.githubusercontent.com/u/1168692?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisobrien","html_url":"https://github.com/dennisobrien","followers_url":"https://api.github.com/users/dennisobrien/followers","following_url":"https://api.github.com/users/dennisobrien/following{/other_user}","gists_url":"https://api.github.com/users/dennisobrien/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisobrien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisobrien/subscriptions","organizations_url":"https://api.github.com/users/dennisobrien/orgs","repos_url":"https://api.github.com/users/dennisobrien/repos","events_url":"https://api.github.com/users/dennisobrien/events{/privacy}","received_events_url":"https://api.github.com/users/dennisobrien/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T07:34:53Z","updated_at":"2016-05-16T07:34:53Z","body":"BTW, this addresses #117 "}}