{"action":"closed","issue":{"url":"https://api.github.com/repos/manahl/arctic/issues/199","repository_url":"https://api.github.com/repos/manahl/arctic","labels_url":"https://api.github.com/repos/manahl/arctic/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/manahl/arctic/issues/199/comments","events_url":"https://api.github.com/repos/manahl/arctic/issues/199/events","html_url":"https://github.com/manahl/arctic/issues/199","id":172661608,"number":199,"title":"Can not filter read query based on date_range using Tickstore","user":{"login":"jpbeveraggi","id":21191740,"avatar_url":"https://avatars.githubusercontent.com/u/21191740?v=3","gravatar_id":"","url":"https://api.github.com/users/jpbeveraggi","html_url":"https://github.com/jpbeveraggi","followers_url":"https://api.github.com/users/jpbeveraggi/followers","following_url":"https://api.github.com/users/jpbeveraggi/following{/other_user}","gists_url":"https://api.github.com/users/jpbeveraggi/gists{/gist_id}","starred_url":"https://api.github.com/users/jpbeveraggi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpbeveraggi/subscriptions","organizations_url":"https://api.github.com/users/jpbeveraggi/orgs","repos_url":"https://api.github.com/users/jpbeveraggi/repos","events_url":"https://api.github.com/users/jpbeveraggi/events{/privacy}","received_events_url":"https://api.github.com/users/jpbeveraggi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-23T10:14:24Z","updated_at":"2016-08-23T12:00:56Z","closed_at":"2016-08-23T12:00:56Z","body":"Hello,\r\nI can not manage to pull tick data from Tickstore based on a DateRange. It pulls the entire database every single time. Here is the method that I am using:\r\n```\r\nimport datetime as dt\r\nimport pandas as pd\r\nfrom arctic.date import string_to_daterange\r\n\r\n@classmethod\r\n\tdef getLastNBars(cls,code,freq,n):\r\n\t\tp = pd.Period( dt.datetime.now(),freq )\r\n\t\tend = dt.datetime(p.year,p.month,p.day,p.hour,p.minute,p.second)\r\n\t\trng = pd.date_range( end=end, periods=n, freq=freq)\r\n\t\tdate_range = string_to_daterange(\"%s-%s\" % (rng[0].strftime(\"%Y%m%d%H%M%z\"), rng[-1].strftime(\"%Y%m%d%H%M%z\")))\r\n\t\tlibrary = cls.store['Tick']\r\n\t\treturn library.read(code,date_range=date_range).mean(axis=1).resample(freq).ohlc().rename(columns={'open':'Open','close':'Close','high':'High','low':'Low'})\r\n```\r\nFor example, the string representation of the date_range I am constructing is:\r\n```\r\nDateRange(start=datetime.datetime(2016, 8, 23, 10, 58), end=datetime.datetime(2016, 8, 23, 11, 2))\r\n```\r\nand the results of the resampling is basically the whole database:\r\n```\r\n                             Open    High     Low   Close\r\n2016-08-23 10:35:00+01:00  2.3885  2.3885  2.3875  2.3880\r\n2016-08-23 10:36:00+01:00  2.3880  2.3885  2.3875  2.3885\r\n2016-08-23 10:37:00+01:00  2.3885  2.3885  2.3875  2.3880\r\n2016-08-23 10:38:00+01:00  2.3885  2.3885  2.3880  2.3885\r\n2016-08-23 10:39:00+01:00  2.3885  2.3895  2.3885  2.3885\r\n2016-08-23 10:40:00+01:00  2.3885  2.3905  2.3885  2.3905\r\n2016-08-23 10:41:00+01:00  2.3905  2.3920  2.3905  2.3915\r\n2016-08-23 10:42:00+01:00  2.3915  2.3930  2.3915  2.3925\r\n2016-08-23 10:43:00+01:00  2.3925  2.3925  2.3900  2.3925\r\n2016-08-23 10:44:00+01:00  2.3925  2.3935  2.3925  2.3935\r\n2016-08-23 10:45:00+01:00  2.3935  2.3940  2.3935  2.3935\r\n2016-08-23 10:46:00+01:00  2.3935  2.3935  2.3925  2.3930\r\n2016-08-23 10:47:00+01:00  2.3930  2.3930  2.3915  2.3925\r\n2016-08-23 10:48:00+01:00  2.3925  2.3925  2.3915  2.3915\r\n2016-08-23 10:49:00+01:00  2.3915  2.3915  2.3900  2.3905\r\n2016-08-23 10:50:00+01:00  2.3905  2.3905  2.3890  2.3890\r\n2016-08-23 10:51:00+01:00  2.3890  2.3890  2.3865  2.3865\r\n2016-08-23 10:52:00+01:00  2.3865  2.3865  2.3860  2.3865\r\n2016-08-23 10:53:00+01:00  2.3865  2.3865  2.3840  2.3840\r\n2016-08-23 10:54:00+01:00  2.3840  2.3845  2.3840  2.3845\r\n2016-08-23 10:55:00+01:00  2.3845  2.3845  2.3845  2.3845\r\n2016-08-23 10:56:00+01:00  2.3845  2.3845  2.3840  2.3840\r\n2016-08-23 10:57:00+01:00  2.3840  2.3840  2.3840  2.3840\r\n2016-08-23 10:58:00+01:00  2.3840  2.3845  2.3815  2.3830\r\n2016-08-23 10:59:00+01:00  2.3835  2.3860  2.3835  2.3855\r\n2016-08-23 11:00:00+01:00  2.3855  2.3855  2.3795  2.3805\r\n2016-08-23 11:01:00+01:00  2.3805  2.3825  2.3790  2.3825\r\n2016-08-23 11:02:00+01:00  2.3825  2.3825  2.3805  2.3805\r\n```\r\nI do not know quite understand where the problem lies since there is no error trace.\r\n\r\nThanks for your help"}}
{"actor":{"display_login":"bmoscon"}}