-
Notifications
You must be signed in to change notification settings - Fork 84
Load tabular data files for chart cells #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
@mbostock was this meant for a different github issue? |
Oops, yes. |
Per the discussion in the other PR, I fear I may have approved this too hastily. I think it is dangerous to repurpose loadTableDataSource for chart cells given that chart cells don’t use this routine to load data when they run—it means that the behavior of how we load data to infer the schema for a chart cell’s data can be inconsistent with how we load data when the chart cell itself runs. I think it would be safer instead to have a dedicated loadChartDataSource routine for chart cells, and I apologize for not realizing the nuances her earlier when I was reviewing. |
Could you explain your reasoning for it being dangerous for chart & table to share |
follow-up in other PR: https://github.com/observablehq/observablehq/pull/10840#discussion_r1124878418 |
The reason it is dangerous (in the sense of likely to exhibit a bug or inconsistent behavior, but not in the security/privacy sense) is that Case in point, Data table cells are compiled to a call to Line 155 in 89f2700
Whereas for chart cells the compiler passes e.g. |
This resolves an error where chart cells were fetching the table schema for a CSV, TSV, JSON, or SQLite file and receiving no columns back.