{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/14904","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14904/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14904/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14904/events","html_url":"https://github.com/pandas-dev/pandas/pull/14904","id":196235312,"number":14904,"title":"ENH: Added to_json_schema","user":{"login":"TomAugspurger","id":1312546,"avatar_url":"https://avatars.githubusercontent.com/u/1312546?v=3","gravatar_id":"","url":"https://api.github.com/users/TomAugspurger","html_url":"https://github.com/TomAugspurger","followers_url":"https://api.github.com/users/TomAugspurger/followers","following_url":"https://api.github.com/users/TomAugspurger/following{/other_user}","gists_url":"https://api.github.com/users/TomAugspurger/gists{/gist_id}","starred_url":"https://api.github.com/users/TomAugspurger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomAugspurger/subscriptions","organizations_url":"https://api.github.com/users/TomAugspurger/orgs","repos_url":"https://api.github.com/users/TomAugspurger/repos","events_url":"https://api.github.com/users/TomAugspurger/events{/privacy}","received_events_url":"https://api.github.com/users/TomAugspurger/received_events","type":"User","site_admin":false},"labels":[{"id":2301354,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Data%20IO","name":"Data IO","color":"06909A","default":false},{"id":31404521,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Dtypes","name":"Dtypes","color":"e102d8","default":false},{"id":76812,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement","name":"Enhancement","color":"4E9A06","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pandas-dev/pandas/milestones/39","html_url":"https://github.com/pandas-dev/pandas/milestone/39","labels_url":"https://api.github.com/repos/pandas-dev/pandas/milestones/39/labels","id":1570595,"number":39,"title":"0.20.0","description":"after 0.19.x series","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"open_issues":190,"closed_issues":376,"state":"open","created_at":"2016-02-08T15:30:21Z","updated_at":"2017-02-06T21:59:36Z","due_on":"2017-02-28T08:00:00Z","closed_at":null},"comments":54,"created_at":"2016-12-17T18:20:08Z","updated_at":"2017-02-06T22:05:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/14904","html_url":"https://github.com/pandas-dev/pandas/pull/14904","diff_url":"https://github.com/pandas-dev/pandas/pull/14904.diff","patch_url":"https://github.com/pandas-dev/pandas/pull/14904.patch"},"body":"Lays the groundwork for (but doesn't close) https://github.com/pandas-dev/pandas/issues/14386\r\nThis handles the schema part of the request there. We'll still need to\r\ndo the work to publish the data to the frontend, but that can be done\r\nas a followup.\r\n\r\nUsage:\r\n\r\n```python\r\nIn [4]: df = pd.DataFrame(\r\n   ...:     {'A': [1, 2, 3],\r\n   ...:      'B': ['a', 'b', 'c'],\r\n   ...:      'C': pd.date_range('2016-01-01', freq='d', periods=3),\r\n   ...:      }, index=pd.Index(range(3), name='idx'))\r\n   ...: df\r\n   ...:\r\nOut[4]:\r\n     A  B          C\r\nidx\r\n0    1  a 2016-01-01\r\n1    2  b 2016-01-02\r\n2    3  c 2016-01-03\r\n\r\nIn [5]:\r\n\r\nIn [5]: pd.to_json_schema(df)\r\nOut[5]:\r\n{'fields': [{'name': 'idx', 'type': 'integer'},\r\n  {'name': 'A', 'type': 'integer'},\r\n  {'name': 'B', 'type': 'string'},\r\n  {'name': 'C', 'type': 'date'}],\r\n 'primary_key': 'idx'}\r\n```\r\n\r\n---\r\n\r\nI think this is useful enough on its own to be part of the public API, so I've documented as such.\r\nI've included a placeholder `publish_tableschema` that will *not* be included in the final commit.\r\nIt's just to make @rgbkrk's life easier for prototyping the nteract frontend. I think the proper solution for publishing the schema + data will have to wait on https://github.com/ipython/ipython/issues/10090"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/277829277","html_url":"https://github.com/pandas-dev/pandas/pull/14904#issuecomment-277829277","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14904","id":277829277,"user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"created_at":"2017-02-06T22:05:49Z","updated_at":"2017-02-06T22:05:49Z","body":"> Just add a '\\n' before the Series / DataFrame text/html repr (feels hacky, and I don't know how that interacts with ipython/ipython#10249/)\r\n\r\nI assume you meant the text/plain repr, rather than text/html? Min's change means that terminal IPython won't call `_ipython_display_()`, so if you add the newline in there (rather than in the return value of `__repr__()`) it should be fine. In other Jupyter frontends (Qt console and Jupyter terminal console), I'd expect that you might see an extra blank line before the normal repr starts."}}
{"actor":{"display_login":"takluyver"}}