{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaData/DataStreams.jl/issues/23","repository_url":"https://api.github.com/repos/JuliaData/DataStreams.jl","labels_url":"https://api.github.com/repos/JuliaData/DataStreams.jl/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/JuliaData/DataStreams.jl/issues/23/comments","events_url":"https://api.github.com/repos/JuliaData/DataStreams.jl/issues/23/events","html_url":"https://github.com/JuliaData/DataStreams.jl/issues/23","id":181322081,"number":23,"title":"The fallback methods for Data.schema seem wrong","user":{"login":"davidanthoff","id":1036561,"avatar_url":"https://avatars.githubusercontent.com/u/1036561?v=3","gravatar_id":"","url":"https://api.github.com/users/davidanthoff","html_url":"https://github.com/davidanthoff","followers_url":"https://api.github.com/users/davidanthoff/followers","following_url":"https://api.github.com/users/davidanthoff/following{/other_user}","gists_url":"https://api.github.com/users/davidanthoff/gists{/gist_id}","starred_url":"https://api.github.com/users/davidanthoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidanthoff/subscriptions","organizations_url":"https://api.github.com/users/davidanthoff/orgs","repos_url":"https://api.github.com/users/davidanthoff/repos","events_url":"https://api.github.com/users/davidanthoff/events{/privacy}","received_events_url":"https://api.github.com/users/davidanthoff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-06T04:28:26Z","updated_at":"2016-10-06T12:12:09Z","closed_at":null,"body":"In particular, this line\r\n\r\nhttps://github.com/JuliaData/DataStreams.jl/blob/master/src/DataStreams.jl#L162\r\n\r\nmeans that if a ``Source`` defines a simple ``Data.schema(::MyPkg.Source)`` method, that method will never be called. For a field based Source, instead this\r\n\r\nhttps://github.com/JuliaData/DataStreams.jl/blob/master/src/DataStreams.jl#L107\r\n\r\nwill be called, which in turn requires a ``Data.schema(source, Data.Column)`` to be defined for the Source.\r\n\r\nAll these fallback methods seem incorrect and inconsistent with the documentation. It seems to me they should all go, and all that would be needed is ``Data.schema(::MyPkg.Source)``?"},"comment":{"url":"https://api.github.com/repos/JuliaData/DataStreams.jl/issues/comments/251943838","html_url":"https://github.com/JuliaData/DataStreams.jl/issues/23#issuecomment-251943838","issue_url":"https://api.github.com/repos/JuliaData/DataStreams.jl/issues/23","id":251943838,"user":{"login":"quinnj","id":2896623,"avatar_url":"https://avatars.githubusercontent.com/u/2896623?v=3","gravatar_id":"","url":"https://api.github.com/users/quinnj","html_url":"https://github.com/quinnj","followers_url":"https://api.github.com/users/quinnj/followers","following_url":"https://api.github.com/users/quinnj/following{/other_user}","gists_url":"https://api.github.com/users/quinnj/gists{/gist_id}","starred_url":"https://api.github.com/users/quinnj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quinnj/subscriptions","organizations_url":"https://api.github.com/users/quinnj/orgs","repos_url":"https://api.github.com/users/quinnj/repos","events_url":"https://api.github.com/users/quinnj/events{/privacy}","received_events_url":"https://api.github.com/users/quinnj/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T12:12:09Z","updated_at":"2016-10-06T12:12:09Z","body":"No, certain sources need to provide a different schema based on whether they're in a Field or Column-based streaming situation (e.g. DataFrames), hence the need for #L162 you mentioned above. This was the only sensible way for things to fall out from that since it'd be a pain to require every Source that happens to support both Field & Column streaming to define 2 different `Data.schema` methods, particularly when `Data.schema(source, ::Type{Data.Field})` can be defined automatically.\r\n\r\nI agree it's not ideal, but I'm not sure there's a cleaner solution out there. I think the docs could certainly be improved; I'm thinking of making the \"if you want to be a Field-based Source\" and \"if you want to be a Column-based Source\" sections and making them more prominent along with emphasis that `Data.schema` needs to explicitly say what type of `Data.StreamType` you support.\r\n\r\nCertainly open to other ideas here."}}
{"actor":{"display_login":"quinnj"}}