{"action":"created","comment":{"url":"https://api.github.com/repos/lsst/daf_io/pulls/comments/131012802","pull_request_review_id":53950522,"id":131012802,"diff_hunk":"@@ -0,0 +1,938 @@\n+# -*- coding: utf-8 -*-\n+\"\"\"\n+Collection of query wrappers / abstractions to both facilitate data\n+retrieval and to reduce dependency on DB-specific API.\n+\"\"\"\n+\n+from __future__ import print_function, division\n+from builtins import str, bytes, zip, range\n+\n+import numpy as np\n+import sqlalchemy\n+import struct\n+\n+from lsst.afw import table as afw_table\n+from sqlalchemy import select\n+from sqlalchemy import Table, Column, Numeric\n+from sqlalchemy.schema import MetaData, CreateTable\n+from sqlalchemy.types import (SmallInteger, Integer, BigInteger,\n+                              Float, String, Boolean, Text)\n+from sqlalchemy.types import to_instance, TypeEngine\n+from contextlib import contextmanager\n+\n+\n+MAX_ARRAY_SIZE = 65535\n+MAX_VARCHAR_SIZE = 512\n+\n+\n+def is_dict_like(obj):\n+    return hasattr(obj, '__getitem__') and hasattr(obj, 'keys')\n+\n+\n+def is_list_like(obj):\n+    return hasattr(obj, '__iter__') and not isinstance(obj, (str, bytes))\n+\n+\n+class DatabaseError(IOError):\n+    pass\n+\n+\n+def read_sql_table(table_name, con, schema=None, column_dtypes=None,\n+                   coerce_float=True, parse_dates=None, columns=None,\n+                   chunksize=None):\n+    \"\"\"Read SQL database table into an afw table.\n+\n+    Given a table name and an SQLAlchemy connectable, returns an Table.\n+    This function does not support DBAPI connections.\n+\n+    Parameters\n+    ----------\n+    table_name : string\n+        Name of SQL table in database\n+    con : SQLAlchemy connectable (or database string URI)\n+    schema : string, default None","path":"python/lsst/daf/io/table/sql.py","position":53,"original_position":53,"commit_id":"3678b47e8c9b85b5ea45eeb9b16975af0a6d2ee6","original_commit_id":"3678b47e8c9b85b5ea45eeb9b16975af0a6d2ee6","user":{"login":"n8pease","id":13370548,"avatar_url":"https://avatars0.githubusercontent.com/u/13370548?v=4","gravatar_id":"","url":"https://api.github.com/users/n8pease","html_url":"https://github.com/n8pease","followers_url":"https://api.github.com/users/n8pease/followers","following_url":"https://api.github.com/users/n8pease/following{/other_user}","gists_url":"https://api.github.com/users/n8pease/gists{/gist_id}","starred_url":"https://api.github.com/users/n8pease/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n8pease/subscriptions","organizations_url":"https://api.github.com/users/n8pease/orgs","repos_url":"https://api.github.com/users/n8pease/repos","events_url":"https://api.github.com/users/n8pease/events{/privacy}","received_events_url":"https://api.github.com/users/n8pease/received_events","type":"User","site_admin":false},"body":"missing a colon in `default None`? on line 56 and on you use the form `default: None`.","created_at":"2017-08-02T22:25:21Z","updated_at":"2017-08-02T22:25:21Z","html_url":"https://github.com/lsst/daf_io/pull/1#discussion_r131012802","pull_request_url":"https://api.github.com/repos/lsst/daf_io/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/lsst/daf_io/pulls/comments/131012802"},"html":{"href":"https://github.com/lsst/daf_io/pull/1#discussion_r131012802"},"pull_request":{"href":"https://api.github.com/repos/lsst/daf_io/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/lsst/daf_io/pulls/1","id":132638976,"html_url":"https://github.com/lsst/daf_io/pull/1","diff_url":"https://github.com/lsst/daf_io/pull/1.diff","patch_url":"https://github.com/lsst/daf_io/pull/1.patch","issue_url":"https://api.github.com/repos/lsst/daf_io/issues/1","number":1,"state":"open","locked":false,"title":"Initial implementation","user":{"login":"brianv0","id":549395,"avatar_url":"https://avatars1.githubusercontent.com/u/549395?v=4","gravatar_id":"","url":"https://api.github.com/users/brianv0","html_url":"https://github.com/brianv0","followers_url":"https://api.github.com/users/brianv0/followers","following_url":"https://api.github.com/users/brianv0/following{/other_user}","gists_url":"https://api.github.com/users/brianv0/gists{/gist_id}","starred_url":"https://api.github.com/users/brianv0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianv0/subscriptions","organizations_url":"https://api.github.com/users/brianv0/orgs","repos_url":"https://api.github.com/users/brianv0/repos","events_url":"https://api.github.com/users/brianv0/events{/privacy}","received_events_url":"https://api.github.com/users/brianv0/received_events","type":"User","site_admin":false},"body":"Work to do: unit tests, Angle/Flag handling, Proper column extraction from table (when writing), a few other things.","created_at":"2017-07-26T23:51:08Z","updated_at":"2017-08-02T22:25:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"374e717e3fbc39f5429b829a5508d87659c43db1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/lsst/daf_io/pulls/1/commits","review_comments_url":"https://api.github.com/repos/lsst/daf_io/pulls/1/comments","review_comment_url":"https://api.github.com/repos/lsst/daf_io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lsst/daf_io/issues/1/comments","statuses_url":"https://api.github.com/repos/lsst/daf_io/statuses/3678b47e8c9b85b5ea45eeb9b16975af0a6d2ee6","head":{"label":"lsst:tickets/DM-10376","ref":"tickets/DM-10376","sha":"3678b47e8c9b85b5ea45eeb9b16975af0a6d2ee6","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars1.githubusercontent.com/u/1134504?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":96895807,"name":"daf_io","full_name":"lsst/daf_io","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars1.githubusercontent.com/u/1134504?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/daf_io","description":"Interfaces for IO","fork":false,"url":"https://api.github.com/repos/lsst/daf_io","forks_url":"https://api.github.com/repos/lsst/daf_io/forks","keys_url":"https://api.github.com/repos/lsst/daf_io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/daf_io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/daf_io/teams","hooks_url":"https://api.github.com/repos/lsst/daf_io/hooks","issue_events_url":"https://api.github.com/repos/lsst/daf_io/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/daf_io/events","assignees_url":"https://api.github.com/repos/lsst/daf_io/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/daf_io/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/daf_io/tags","blobs_url":"https://api.github.com/repos/lsst/daf_io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/daf_io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/daf_io/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/daf_io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/daf_io/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/daf_io/languages","stargazers_url":"https://api.github.com/repos/lsst/daf_io/stargazers","contributors_url":"https://api.github.com/repos/lsst/daf_io/contributors","subscribers_url":"https://api.github.com/repos/lsst/daf_io/subscribers","subscription_url":"https://api.github.com/repos/lsst/daf_io/subscription","commits_url":"https://api.github.com/repos/lsst/daf_io/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/daf_io/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/daf_io/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/daf_io/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/daf_io/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/daf_io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/daf_io/merges","archive_url":"https://api.github.com/repos/lsst/daf_io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/daf_io/downloads","issues_url":"https://api.github.com/repos/lsst/daf_io/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/daf_io/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/daf_io/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/daf_io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/daf_io/labels{/name}","releases_url":"https://api.github.com/repos/lsst/daf_io/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/daf_io/deployments","created_at":"2017-07-11T13:25:09Z","updated_at":"2017-07-11T13:25:35Z","pushed_at":"2017-07-26T23:51:08Z","git_url":"git://github.com/lsst/daf_io.git","ssh_url":"git@github.com:lsst/daf_io.git","clone_url":"https://github.com/lsst/daf_io.git","svn_url":"https://github.com/lsst/daf_io","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lsst:master","ref":"master","sha":"66e6ed8b3f3ae84f4cedb73fd3d7424db2c60346","user":{"login":"lsst","id":1134504,"avatar_url":"https://avatars1.githubusercontent.com/u/1134504?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"repo":{"id":96895807,"name":"daf_io","full_name":"lsst/daf_io","owner":{"login":"lsst","id":1134504,"avatar_url":"https://avatars1.githubusercontent.com/u/1134504?v=4","gravatar_id":"","url":"https://api.github.com/users/lsst","html_url":"https://github.com/lsst","followers_url":"https://api.github.com/users/lsst/followers","following_url":"https://api.github.com/users/lsst/following{/other_user}","gists_url":"https://api.github.com/users/lsst/gists{/gist_id}","starred_url":"https://api.github.com/users/lsst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsst/subscriptions","organizations_url":"https://api.github.com/users/lsst/orgs","repos_url":"https://api.github.com/users/lsst/repos","events_url":"https://api.github.com/users/lsst/events{/privacy}","received_events_url":"https://api.github.com/users/lsst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lsst/daf_io","description":"Interfaces for IO","fork":false,"url":"https://api.github.com/repos/lsst/daf_io","forks_url":"https://api.github.com/repos/lsst/daf_io/forks","keys_url":"https://api.github.com/repos/lsst/daf_io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lsst/daf_io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lsst/daf_io/teams","hooks_url":"https://api.github.com/repos/lsst/daf_io/hooks","issue_events_url":"https://api.github.com/repos/lsst/daf_io/issues/events{/number}","events_url":"https://api.github.com/repos/lsst/daf_io/events","assignees_url":"https://api.github.com/repos/lsst/daf_io/assignees{/user}","branches_url":"https://api.github.com/repos/lsst/daf_io/branches{/branch}","tags_url":"https://api.github.com/repos/lsst/daf_io/tags","blobs_url":"https://api.github.com/repos/lsst/daf_io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lsst/daf_io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lsst/daf_io/git/refs{/sha}","trees_url":"https://api.github.com/repos/lsst/daf_io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lsst/daf_io/statuses/{sha}","languages_url":"https://api.github.com/repos/lsst/daf_io/languages","stargazers_url":"https://api.github.com/repos/lsst/daf_io/stargazers","contributors_url":"https://api.github.com/repos/lsst/daf_io/contributors","subscribers_url":"https://api.github.com/repos/lsst/daf_io/subscribers","subscription_url":"https://api.github.com/repos/lsst/daf_io/subscription","commits_url":"https://api.github.com/repos/lsst/daf_io/commits{/sha}","git_commits_url":"https://api.github.com/repos/lsst/daf_io/git/commits{/sha}","comments_url":"https://api.github.com/repos/lsst/daf_io/comments{/number}","issue_comment_url":"https://api.github.com/repos/lsst/daf_io/issues/comments{/number}","contents_url":"https://api.github.com/repos/lsst/daf_io/contents/{+path}","compare_url":"https://api.github.com/repos/lsst/daf_io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lsst/daf_io/merges","archive_url":"https://api.github.com/repos/lsst/daf_io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lsst/daf_io/downloads","issues_url":"https://api.github.com/repos/lsst/daf_io/issues{/number}","pulls_url":"https://api.github.com/repos/lsst/daf_io/pulls{/number}","milestones_url":"https://api.github.com/repos/lsst/daf_io/milestones{/number}","notifications_url":"https://api.github.com/repos/lsst/daf_io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lsst/daf_io/labels{/name}","releases_url":"https://api.github.com/repos/lsst/daf_io/releases{/id}","deployments_url":"https://api.github.com/repos/lsst/daf_io/deployments","created_at":"2017-07-11T13:25:09Z","updated_at":"2017-07-11T13:25:35Z","pushed_at":"2017-07-26T23:51:08Z","git_url":"git://github.com/lsst/daf_io.git","ssh_url":"git@github.com:lsst/daf_io.git","clone_url":"https://github.com/lsst/daf_io.git","svn_url":"https://github.com/lsst/daf_io","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lsst/daf_io/pulls/1"},"html":{"href":"https://github.com/lsst/daf_io/pull/1"},"issue":{"href":"https://api.github.com/repos/lsst/daf_io/issues/1"},"comments":{"href":"https://api.github.com/repos/lsst/daf_io/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/lsst/daf_io/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/lsst/daf_io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lsst/daf_io/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/lsst/daf_io/statuses/3678b47e8c9b85b5ea45eeb9b16975af0a6d2ee6"}}}}
{"actor":{"display_login":"n8pease"}}