{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/14486","repository_url":"https://api.github.com/repos/CartoDB/cartodb","labels_url":"https://api.github.com/repos/CartoDB/cartodb/issues/14486/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/14486/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/14486/events","html_url":"https://github.com/CartoDB/cartodb/pull/14486","id":383889449,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMjUxNjQ1","number":14486,"title":"Dependent visualizations for Visualizations API","user":{"login":"gonzaloriestra","id":14979109,"node_id":"MDQ6VXNlcjE0OTc5MTA5","avatar_url":"https://avatars0.githubusercontent.com/u/14979109?v=4","gravatar_id":"","url":"https://api.github.com/users/gonzaloriestra","html_url":"https://github.com/gonzaloriestra","followers_url":"https://api.github.com/users/gonzaloriestra/followers","following_url":"https://api.github.com/users/gonzaloriestra/following{/other_user}","gists_url":"https://api.github.com/users/gonzaloriestra/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzaloriestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzaloriestra/subscriptions","organizations_url":"https://api.github.com/users/gonzaloriestra/orgs","repos_url":"https://api.github.com/users/gonzaloriestra/repos","events_url":"https://api.github.com/users/gonzaloriestra/events{/privacy}","received_events_url":"https://api.github.com/users/gonzaloriestra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gonzaloriestra","id":14979109,"node_id":"MDQ6VXNlcjE0OTc5MTA5","avatar_url":"https://avatars0.githubusercontent.com/u/14979109?v=4","gravatar_id":"","url":"https://api.github.com/users/gonzaloriestra","html_url":"https://github.com/gonzaloriestra","followers_url":"https://api.github.com/users/gonzaloriestra/followers","following_url":"https://api.github.com/users/gonzaloriestra/following{/other_user}","gists_url":"https://api.github.com/users/gonzaloriestra/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzaloriestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzaloriestra/subscriptions","organizations_url":"https://api.github.com/users/gonzaloriestra/orgs","repos_url":"https://api.github.com/users/gonzaloriestra/repos","events_url":"https://api.github.com/users/gonzaloriestra/events{/privacy}","received_events_url":"https://api.github.com/users/gonzaloriestra/received_events","type":"User","site_admin":false},"assignees":[{"login":"gonzaloriestra","id":14979109,"node_id":"MDQ6VXNlcjE0OTc5MTA5","avatar_url":"https://avatars0.githubusercontent.com/u/14979109?v=4","gravatar_id":"","url":"https://api.github.com/users/gonzaloriestra","html_url":"https://github.com/gonzaloriestra","followers_url":"https://api.github.com/users/gonzaloriestra/followers","following_url":"https://api.github.com/users/gonzaloriestra/following{/other_user}","gists_url":"https://api.github.com/users/gonzaloriestra/gists{/gist_id}","starred_url":"https://api.github.com/users/gonzaloriestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonzaloriestra/subscriptions","organizations_url":"https://api.github.com/users/gonzaloriestra/orgs","repos_url":"https://api.github.com/users/gonzaloriestra/repos","events_url":"https://api.github.com/users/gonzaloriestra/events{/privacy}","received_events_url":"https://api.github.com/users/gonzaloriestra/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-11-23T17:05:58Z","updated_at":"2018-11-28T09:04:33Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/14486","html_url":"https://github.com/CartoDB/cartodb/pull/14486","diff_url":"https://github.com/CartoDB/cartodb/pull/14486.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/14486.patch"},"body":"Related to https://github.com/CartoDB/cartodb/issues/14424\r\n\r\nThe /viz endpoint now supports a new parameter: `with_dependent_visualizations=5` which allows adding the count of dependent visualizations and the most recent of them, limited by the parameter number (0 by default), including this info:\r\n\r\n```\r\n{\r\n  \"visualizations\": [\r\n    {\r\n      ...\r\n      \"dependent_visualizations_count\": 7,\r\n      \"dependent_visualizations\": [\r\n        {\r\n          \"id\": \"cc1870e7-c2ac-4e3c-8e89-f84c061b7a10\",\r\n          \"name\": \"Untitled Map\",\r\n          \"updated_at\": \"2018-10-23T13:07:02.860Z\",\r\n          \"permission\": {\r\n            \"id\": \"3bc87961-d713-4cfd-83f9-40638ac90157\",\r\n            \"owner\": { ... }\r\n          },\r\n          \"auth_tokens\": []\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nIt also allows to order by `dependent_visualizations`.\r\n\r\nRegarding the implementation, the required tables have been added in the query builder by eager loading in order to avoid the N+1 problem. The performance of the query seems to be good in production with a high number of datasets (~150)."},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments/442371724","html_url":"https://github.com/CartoDB/cartodb/pull/14486#issuecomment-442371724","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/14486","id":442371724,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjM3MTcyNA==","user":{"login":"alrocar","id":623650,"node_id":"MDQ6VXNlcjYyMzY1MA==","avatar_url":"https://avatars0.githubusercontent.com/u/623650?v=4","gravatar_id":"","url":"https://api.github.com/users/alrocar","html_url":"https://github.com/alrocar","followers_url":"https://api.github.com/users/alrocar/followers","following_url":"https://api.github.com/users/alrocar/following{/other_user}","gists_url":"https://api.github.com/users/alrocar/gists{/gist_id}","starred_url":"https://api.github.com/users/alrocar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alrocar/subscriptions","organizations_url":"https://api.github.com/users/alrocar/orgs","repos_url":"https://api.github.com/users/alrocar/repos","events_url":"https://api.github.com/users/alrocar/events{/privacy}","received_events_url":"https://api.github.com/users/alrocar/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T09:04:33Z","updated_at":"2018-11-28T09:04:33Z","author_association":"MEMBER","body":"I tested ordering by dependent_visualizations.\r\n\r\nAbout paging, I actually tested it on tables, I had fewer than 10 elements with 1000 related maps, so probably not a good test... It took more than 10 seconds the response."}}
{"actor":{"display_login":"alrocar"}}