{"action":"created","issue":{"url":"https://api.github.com/repos/juttle/juttle-influx-adapter/issues/50","repository_url":"https://api.github.com/repos/juttle/juttle-influx-adapter","labels_url":"https://api.github.com/repos/juttle/juttle-influx-adapter/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/juttle/juttle-influx-adapter/issues/50/comments","events_url":"https://api.github.com/repos/juttle/juttle-influx-adapter/issues/50/events","html_url":"https://github.com/juttle/juttle-influx-adapter/pull/50","id":130937784,"number":50,"title":"time-filter.js - fix time handling w/o where","user":{"login":"bkutil","id":696026,"avatar_url":"https://avatars.githubusercontent.com/u/696026?v=3","gravatar_id":"","url":"https://api.github.com/users/bkutil","html_url":"https://github.com/bkutil","followers_url":"https://api.github.com/users/bkutil/followers","following_url":"https://api.github.com/users/bkutil/following{/other_user}","gists_url":"https://api.github.com/users/bkutil/gists{/gist_id}","starred_url":"https://api.github.com/users/bkutil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkutil/subscriptions","organizations_url":"https://api.github.com/users/bkutil/orgs","repos_url":"https://api.github.com/users/bkutil/repos","events_url":"https://api.github.com/users/bkutil/events{/privacy}","received_events_url":"https://api.github.com/users/bkutil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/juttle/juttle-influx-adapter/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-03T07:21:50Z","updated_at":"2016-02-03T08:55:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/juttle/juttle-influx-adapter/pulls/50","html_url":"https://github.com/juttle/juttle-influx-adapter/pull/50","diff_url":"https://github.com/juttle/juttle-influx-adapter/pull/50.diff","patch_url":"https://github.com/juttle/juttle-influx-adapter/pull/50.patch"},"body":"Fix edge case triggered when 'nameField' gets filtered out from the\r\nfilter AST, where clause is thus equal to undefined and from / to is\r\nspecified.\r\n\r\nTime-filter was not be able to cope with undefineds - it stringified it,\r\ninstead of starting with an empty string."},"comment":{"url":"https://api.github.com/repos/juttle/juttle-influx-adapter/issues/comments/179101111","html_url":"https://github.com/juttle/juttle-influx-adapter/pull/50#issuecomment-179101111","issue_url":"https://api.github.com/repos/juttle/juttle-influx-adapter/issues/50","id":179101111,"user":{"login":"dmajda","id":18821,"avatar_url":"https://avatars.githubusercontent.com/u/18821?v=3","gravatar_id":"","url":"https://api.github.com/users/dmajda","html_url":"https://github.com/dmajda","followers_url":"https://api.github.com/users/dmajda/followers","following_url":"https://api.github.com/users/dmajda/following{/other_user}","gists_url":"https://api.github.com/users/dmajda/gists{/gist_id}","starred_url":"https://api.github.com/users/dmajda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmajda/subscriptions","organizations_url":"https://api.github.com/users/dmajda/orgs","repos_url":"https://api.github.com/users/dmajda/repos","events_url":"https://api.github.com/users/dmajda/events{/privacy}","received_events_url":"https://api.github.com/users/dmajda/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T08:55:40Z","updated_at":"2016-02-03T08:55:40Z","body":"It seems odd to me that `WhereBuilder` signals an empty query using `undefined` while `Time.prototype.addTimeFilter` signals it using an empty string. This should be unified. Unifying to `undefined` is probably more logical, OTOH unifying to an empty string would allow you to get rid of the test at the beginning of `Time.prototype.addTimeFilter`. (As a side note, I think `null` would be more appropriate value than `undefined` in this situation, but we don’t have to deal with that in this PR.)\r\n\r\nAlso, given at least one of `from` and `to` is always present, `addTimeFilter` should in practice never produce an empty query. This makes the test at the end of `SelectBuilder.prototype._where` redundant and it means the `if (where !== '' && (from || to))` condition in `Time.prototype.addTimeFilter` can be simplified."}}