{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/12206","repository_url":"https://api.github.com/repos/CartoDB/cartodb","labels_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12206/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12206/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12206/events","html_url":"https://github.com/CartoDB/cartodb/issues/12206","id":231286074,"number":12206,"title":"[OBS] Boundaries query templates need parenthesis fix","user":{"login":"rafatower","id":1914276,"avatar_url":"https://avatars2.githubusercontent.com/u/1914276?v=3","gravatar_id":"","url":"https://api.github.com/users/rafatower","html_url":"https://github.com/rafatower","followers_url":"https://api.github.com/users/rafatower/followers","following_url":"https://api.github.com/users/rafatower/following{/other_user}","gists_url":"https://api.github.com/users/rafatower/gists{/gist_id}","starred_url":"https://api.github.com/users/rafatower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafatower/subscriptions","organizations_url":"https://api.github.com/users/rafatower/orgs","repos_url":"https://api.github.com/users/rafatower/repos","events_url":"https://api.github.com/users/rafatower/events{/privacy}","received_events_url":"https://api.github.com/users/rafatower/received_events","type":"User","site_admin":false},"labels":[{"id":8530709,"url":"https://api.github.com/repos/CartoDB/cartodb/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"nobuti","id":1366843,"avatar_url":"https://avatars3.githubusercontent.com/u/1366843?v=3","gravatar_id":"","url":"https://api.github.com/users/nobuti","html_url":"https://github.com/nobuti","followers_url":"https://api.github.com/users/nobuti/followers","following_url":"https://api.github.com/users/nobuti/following{/other_user}","gists_url":"https://api.github.com/users/nobuti/gists{/gist_id}","starred_url":"https://api.github.com/users/nobuti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nobuti/subscriptions","organizations_url":"https://api.github.com/users/nobuti/orgs","repos_url":"https://api.github.com/users/nobuti/repos","events_url":"https://api.github.com/users/nobuti/events{/privacy}","received_events_url":"https://api.github.com/users/nobuti/received_events","type":"User","site_admin":false},"assignees":[{"login":"nobuti","id":1366843,"avatar_url":"https://avatars3.githubusercontent.com/u/1366843?v=3","gravatar_id":"","url":"https://api.github.com/users/nobuti","html_url":"https://github.com/nobuti","followers_url":"https://api.github.com/users/nobuti/followers","following_url":"https://api.github.com/users/nobuti/following{/other_user}","gists_url":"https://api.github.com/users/nobuti/gists{/gist_id}","starred_url":"https://api.github.com/users/nobuti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nobuti/subscriptions","organizations_url":"https://api.github.com/users/nobuti/orgs","repos_url":"https://api.github.com/users/nobuti/repos","events_url":"https://api.github.com/users/nobuti/events{/privacy}","received_events_url":"https://api.github.com/users/nobuti/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2017-05-25T09:25:02Z","updated_at":"2017-05-31T17:25:45Z","closed_at":null,"body":"While resolving some questions about OBS functions and integration we found out an issue with one of the query templates. These templates with the `OR` clause:\r\n\r\nhttps://github.com/CartoDB/cartodb/blob/d8614f137cab6980a9fe8fd18f5d6a833ec98a66/lib/assets/core/javascripts/cartodb3/data/data-observatory/boundaries-collection.js#L5-L11\r\n\r\nshall include parenthesis to enforce the correct precedence:\r\n```sql\r\nSELECT * FROM OBS_GetAvailableGeometries(\r\n  ST_MakeEnvelope(-74, 41, -73, 40, 4326),\r\n  NULL,\r\n  <numer_id>,\r\n  <denom_id>, \r\n  <timespan_id>\r\n) denoms\r\nWHERE valid_numer IS TRUE\r\n AND (valid_denom IS TRUE OR <denom_id> IS NULL) -- edited\r\n AND valid_timespan IS TRUE\r\n```\r\nas explained in https://github.com/CartoDB/dataservices-api/issues/370#issuecomment-303959407"},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments/305258287","html_url":"https://github.com/CartoDB/cartodb/issues/12206#issuecomment-305258287","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12206","id":305258287,"user":{"login":"nobuti","id":1366843,"avatar_url":"https://avatars3.githubusercontent.com/u/1366843?v=3","gravatar_id":"","url":"https://api.github.com/users/nobuti","html_url":"https://github.com/nobuti","followers_url":"https://api.github.com/users/nobuti/followers","following_url":"https://api.github.com/users/nobuti/following{/other_user}","gists_url":"https://api.github.com/users/nobuti/gists{/gist_id}","starred_url":"https://api.github.com/users/nobuti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nobuti/subscriptions","organizations_url":"https://api.github.com/users/nobuti/orgs","repos_url":"https://api.github.com/users/nobuti/repos","events_url":"https://api.github.com/users/nobuti/events{/privacy}","received_events_url":"https://api.github.com/users/nobuti/received_events","type":"User","site_admin":false},"created_at":"2017-05-31T17:25:45Z","updated_at":"2017-05-31T17:25:45Z","body":"Ok, I'll remove that part of the query if not value, but it worries me that the other query it works, with the same logic."}}
{"actor":{"display_login":"nobuti"}}