{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/12036","repository_url":"https://api.github.com/repos/CartoDB/cartodb","labels_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12036/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12036/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12036/events","html_url":"https://github.com/CartoDB/cartodb/pull/12036","id":223746803,"number":12036,"title":"12018 sql function","user":{"login":"ivanmalagon","id":1078228,"avatar_url":"https://avatars3.githubusercontent.com/u/1078228?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanmalagon","html_url":"https://github.com/ivanmalagon","followers_url":"https://api.github.com/users/ivanmalagon/followers","following_url":"https://api.github.com/users/ivanmalagon/following{/other_user}","gists_url":"https://api.github.com/users/ivanmalagon/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanmalagon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanmalagon/subscriptions","organizations_url":"https://api.github.com/users/ivanmalagon/orgs","repos_url":"https://api.github.com/users/ivanmalagon/repos","events_url":"https://api.github.com/users/ivanmalagon/events{/privacy}","received_events_url":"https://api.github.com/users/ivanmalagon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-24T08:53:30Z","updated_at":"2017-05-08T16:41:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/12036","html_url":"https://github.com/CartoDB/cartodb/pull/12036","diff_url":"https://github.com/CartoDB/cartodb/pull/12036.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/12036.patch"},"body":"Implements #12018 \r\n\r\nThis adds to the analyses suite one to run custom SQL functions. Those SQL functions must follow the guidelines described at [deprecated-sql-function-analysis](https://github.com/CartoDB/camshaft/blob/ca43718cc25563d491f27616a3c7891439171b51/docs/deprecated-sql-function.md#deprecated-sql-function-analysis)\r\n\r\nSince this is not a trivial task, several functions are provided in the DED01 environment to do this acceptance.\r\n\r\nAcceptance\r\n-----------\r\n\r\n### Credentials\r\n\r\nThis version is deployed in DED01.\r\n\r\nYou must log in at https://carto-staging.com/login as:\r\n- user: busta-01\r\n- password: vizzualejo\r\n\r\n### Analysis acceptance\r\n\r\n- Create a map with a couple of datasets.\r\n- Select one layer, go to `analysis` tab and click on `add analysis`\r\n- `SQL Function`should be there. Click on it.\r\n- There are three main example functions:\r\n    - DEP_EXT_buffer: this only has an integer parameter. Check that it works. This analysis is interesting because it has no secondary node. If it works, it means that the validations of the analysis params are working properly.\r\n    - DEP_EXT_interpolation: this has text and number parameters. I won't say a thing about it in order for you to discover edge cases playing with the input. This one has a mandatory secondary node.\r\n    - DEP_EXT_fixed_buffer: this has a boolean parameter. Just to test that the form renders boolean params.\r\n\r\nAfter applying the analysis with correct input, the typical overlay page informing the user that the analysis has finished should show up. If not, there's something wrong.\r\n\r\nThis analysis is intended for 'pro' audience and it's generated automatically, so there's no much information in case something goes wrong. Play with it and write down your thoughts about what can be improved (if you think that).\r\n\r\nFeel free to add your own functions following the guideline pointed above. @javisantana and @AbelVM did it already with mixed results.\r\n\r\n### Feature flag acceptance\r\n\r\nThis analysis is under a feature flag. Go to central and enable / disable the feature flag on the user profile and check that the analysis option shows / hides. \r\n\r\n### Data services enabled analyses\r\n\r\nI had to do a mini-refactor to the function that tells if an analysis can be executed or not. Please check that the next analysis simply work running an analysis:\r\n- georeference-city\r\n- georeference-street-address\r\n- routing (sequential or single point)\r\n- Enrich data from data observatory\r\n\r\nPing me if you need further clarifications or help.\r\n"},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments/299921062","html_url":"https://github.com/CartoDB/cartodb/pull/12036#issuecomment-299921062","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12036","id":299921062,"user":{"login":"ivanmalagon","id":1078228,"avatar_url":"https://avatars3.githubusercontent.com/u/1078228?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanmalagon","html_url":"https://github.com/ivanmalagon","followers_url":"https://api.github.com/users/ivanmalagon/followers","following_url":"https://api.github.com/users/ivanmalagon/following{/other_user}","gists_url":"https://api.github.com/users/ivanmalagon/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanmalagon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanmalagon/subscriptions","organizations_url":"https://api.github.com/users/ivanmalagon/orgs","repos_url":"https://api.github.com/users/ivanmalagon/repos","events_url":"https://api.github.com/users/ivanmalagon/events{/privacy}","received_events_url":"https://api.github.com/users/ivanmalagon/received_events","type":"User","site_admin":false},"created_at":"2017-05-08T16:41:05Z","updated_at":"2017-05-08T16:41:05Z","body":"@AbelVM \r\n\r\nRegarding your problem with your DEP_EXT_curvature function.\r\n\r\nWhen I developed this task I talked with @rochoa and he told me that all function arguments should be mandatory. In your function, there's one that should go empty according to your dataset. That's the first thing.\r\n\r\nLocally, I've bypassed the required validation and then I get the error\r\n```\r\ncolumn reference \"the_geom_webmercator\" is ambiguous\r\n```\r\n\r\nthat suggest that either your function or the code that runs the function is creating the column `the_geom_webmercator` in at least two subtables and the `select` operation doesn't know which one is the result referring to.\r\n\r\nWe need to argue on the required validation. We should agree on either we leave all fields optionals or not. We can't select which ones because this is a dynamic analysis and so far we only have the type description of the params.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"ivanmalagon"}}