{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/7893","repository_url":"https://api.github.com/repos/bokeh/bokeh","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/7893/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/7893/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/7893/events","html_url":"https://github.com/bokeh/bokeh/pull/7893","id":322602172,"number":7893,"title":"Fixes #3596: Warn on generating static HTML with Python callbacks","user":{"login":"Karel-van-de-Plassche","id":6404167,"avatar_url":"https://avatars1.githubusercontent.com/u/6404167?v=4","gravatar_id":"","url":"https://api.github.com/users/Karel-van-de-Plassche","html_url":"https://github.com/Karel-van-de-Plassche","followers_url":"https://api.github.com/users/Karel-van-de-Plassche/followers","following_url":"https://api.github.com/users/Karel-van-de-Plassche/following{/other_user}","gists_url":"https://api.github.com/users/Karel-van-de-Plassche/gists{/gist_id}","starred_url":"https://api.github.com/users/Karel-van-de-Plassche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Karel-van-de-Plassche/subscriptions","organizations_url":"https://api.github.com/users/Karel-van-de-Plassche/orgs","repos_url":"https://api.github.com/users/Karel-van-de-Plassche/repos","events_url":"https://api.github.com/users/Karel-van-de-Plassche/events{/privacy}","received_events_url":"https://api.github.com/users/Karel-van-de-Plassche/received_events","type":"User","site_admin":false},"labels":[{"id":88662516,"url":"https://api.github.com/repos/bokeh/bokeh/labels/status:%20ready","name":"status: ready","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-05-13T15:14:23Z","updated_at":"2018-05-25T20:34:55Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/7893","html_url":"https://github.com/bokeh/bokeh/pull/7893","diff_url":"https://github.com/bokeh/bokeh/pull/7893.diff","patch_url":"https://github.com/bokeh/bokeh/pull/7893.patch"},"body":"Thought the safest way to check this is on static HTML generation. Does not warn when generating JSON though, but don't think it is needed. You can test this functionality with this snippet:\r\n\r\n``` python\r\nfrom bokeh.io import curdoc, show\r\nfrom bokeh.plotting import figure\r\nfrom bokeh.models.widgets import Button\r\nfrom bokeh.models import CustomJS\r\nfrom bokeh.layouts import column\r\nfrom bokeh.events import ButtonClick\r\n\r\nfrom IPython import embed\r\n\r\n# Create plot and buttons\r\nplot = figure(plot_height=400, plot_width=400)\r\nclick_button = Button()\r\nchange_button = Button()\r\nevent_button = Button()\r\nchange_js_button = Button()\r\nevent_js_button = Button()\r\n\r\n# Define callbacks\r\ndef handler(*args):\r\n    print('Clicked!')\r\n\r\ndef handler2(attr, old, new):\r\n    print('Clicked!')\r\n\r\njs_handler = CustomJS(code='console.log(\"JS:Click\")')\r\n\r\n# Connect callbacks\r\nclick_button.on_click(handler)\r\nchange_button.on_change('clicks', handler2)\r\nevent_button.on_event(ButtonClick, handler)\r\nchange_js_button.js_on_click(js_handler)\r\nevent_js_button.js_on_event(ButtonClick, js_handler)\r\n\r\n# Add to layout. Run with `bokeh serve` for no warnings, or run with python or `bokeh html` for warnings\r\nlayout = column(plot, click_button, change_button, event_button, change_js_button, event_js_button)\r\ncurdoc().add_root(layout)\r\nshow(layout)\r\n```\r\n\r\n- [x] issues: fixes #3596\r\n- [x] tests added / passed\r\n\r\nWas not sure where and if to put a test for this, not very familiar with selinium, but looking into it."},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/392175765","html_url":"https://github.com/bokeh/bokeh/pull/7893#issuecomment-392175765","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/7893","id":392175765,"user":{"login":"bryevdv","id":1078448,"avatar_url":"https://avatars3.githubusercontent.com/u/1078448?v=4","gravatar_id":"","url":"https://api.github.com/users/bryevdv","html_url":"https://github.com/bryevdv","followers_url":"https://api.github.com/users/bryevdv/followers","following_url":"https://api.github.com/users/bryevdv/following{/other_user}","gists_url":"https://api.github.com/users/bryevdv/gists{/gist_id}","starred_url":"https://api.github.com/users/bryevdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryevdv/subscriptions","organizations_url":"https://api.github.com/users/bryevdv/orgs","repos_url":"https://api.github.com/users/bryevdv/repos","events_url":"https://api.github.com/users/bryevdv/events{/privacy}","received_events_url":"https://api.github.com/users/bryevdv/received_events","type":"User","site_admin":false},"created_at":"2018-05-25T20:34:55Z","updated_at":"2018-05-25T20:34:55Z","author_association":"MEMBER","body":"@Karel-van-de-Plassche looks great, thanks for the PR!"}}
{"actor":{"display_login":"bryevdv"}}