{"action":"created","issue":{"url":"https://api.github.com/repos/quantopian/zipline/issues/743","labels_url":"https://api.github.com/repos/quantopian/zipline/issues/743/labels{/name}","comments_url":"https://api.github.com/repos/quantopian/zipline/issues/743/comments","events_url":"https://api.github.com/repos/quantopian/zipline/issues/743/events","html_url":"https://github.com/quantopian/zipline/pull/743","id":109370410,"number":743,"title":"Add lookup_future_symbol method and future_symbol API method","user":{"login":"StewartDouglas","id":5628197,"avatar_url":"https://avatars.githubusercontent.com/u/5628197?v=3","gravatar_id":"","url":"https://api.github.com/users/StewartDouglas","html_url":"https://github.com/StewartDouglas","followers_url":"https://api.github.com/users/StewartDouglas/followers","following_url":"https://api.github.com/users/StewartDouglas/following{/other_user}","gists_url":"https://api.github.com/users/StewartDouglas/gists{/gist_id}","starred_url":"https://api.github.com/users/StewartDouglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StewartDouglas/subscriptions","organizations_url":"https://api.github.com/users/StewartDouglas/orgs","repos_url":"https://api.github.com/users/StewartDouglas/repos","events_url":"https://api.github.com/users/StewartDouglas/events{/privacy}","received_events_url":"https://api.github.com/users/StewartDouglas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/quantopian/zipline/labels/In%20Progress","name":"In Progress","color":"00ffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T19:52:19Z","updated_at":"2015-10-05T14:29:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/quantopian/zipline/pulls/743","html_url":"https://github.com/quantopian/zipline/pull/743","diff_url":"https://github.com/quantopian/zipline/pull/743.diff","patch_url":"https://github.com/quantopian/zipline/pull/743.patch"},"body":"** DO NOT MERGE ** \r\n\r\ncc @jfkirk @warren-oneill @yankees714 \r\n\r\nOpening up this PR to discuss the addition of a `future_symbol()` API method and an internal `lookup_future_symbol()` method. \r\n\r\nI have added an index to the symbol column in the futures SQL table to speed up lookup times, and while I was at it I felt it that an SQL UNIQUE constraint would also be relevant since there should never be a collision of futures symbols. Note that this change initially caused one of the existing tests (which duplicates an entry in this column) to fail, so the test has been changed.\r\nUpdate: the root symbols coming from our data provider are unique, and hence the symbols of individual contracts are unique. Hence it makes sense to impose the UNQIUE constraint.\r\n\r\nOutstanding:\r\n\r\n- [x] Refactor failing test or remove UNIQUE constraint.\r\n- [x] Add future_symbol API method.\r\n- [x] Take into account the changes in https://github.com/quantopian/zipline/pull/746\r\n- [ ] Add more tests. \r\n- [x] Move lookup_future_symbol tests to their own class, or more appropriate place. \r\n- [ ] Add validation that user has provided one and only one string arg.\r\n- [ ] Update internal API documentation."},"comment":{"url":"https://api.github.com/repos/quantopian/zipline/issues/comments/145546511","html_url":"https://github.com/quantopian/zipline/pull/743#issuecomment-145546511","issue_url":"https://api.github.com/repos/quantopian/zipline/issues/743","id":145546511,"user":{"login":"warren-oneill","id":10514666,"avatar_url":"https://avatars.githubusercontent.com/u/10514666?v=3","gravatar_id":"","url":"https://api.github.com/users/warren-oneill","html_url":"https://github.com/warren-oneill","followers_url":"https://api.github.com/users/warren-oneill/followers","following_url":"https://api.github.com/users/warren-oneill/following{/other_user}","gists_url":"https://api.github.com/users/warren-oneill/gists{/gist_id}","starred_url":"https://api.github.com/users/warren-oneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warren-oneill/subscriptions","organizations_url":"https://api.github.com/users/warren-oneill/orgs","repos_url":"https://api.github.com/users/warren-oneill/repos","events_url":"https://api.github.com/users/warren-oneill/events{/privacy}","received_events_url":"https://api.github.com/users/warren-oneill/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T14:29:53Z","updated_at":"2015-10-05T14:29:53Z","body":"this looks great :smile: exactly what I need"}}