observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
957 stars 83 forks source link

Remove .columns #365

Closed annie closed 1 year ago

annie commented 1 year ago

(Based on a suggestion from Mike)

Remove .columns from __table. It's no longer needed since we always guarantee that we'll return a .schema, and .schema is a superset of the information in .columns.

One thing I'm not too sure about – if the source has a .columns property and the source isn't modified in __table, the .columns property will pass through and remain in the output. Is that ok, or do we need to standardize __table by making sure .schema is the only property on the output?

annie commented 1 year ago

yep that makes sense to me! thinking about it a bit more, there could be any number of properties on source that we just pass through right now, so it makes sense to treat .columns as just one of those.