Skip to content
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

Contract docs: Table contract #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Contract docs: Table contract #20

wants to merge 2 commits into from

Conversation

yesoreyeram
Copy link
Collaborator

@yesoreyeram yesoreyeram commented May 17, 2023

This PR adds proposal for table kind contract with two formats ( table plain and table frame ).

Why this is required

If a data frame doesn't falls under timeseries, numeric or any other known kinds, By specifying this as table kind will let the consumers know how to handle it without any guess work. Say example, when a frame have three fields ( date-of-birth (time), name(string) and age(number) ), it can be easily misinterpreted either as timeseries or numeric. So by specifying table kind, consumers can handle this without confusion.

Why two different formats

This PR proposes two different format (table plain and table frame ) under table kind.

By specifying table plain it will become clear that the consumer doesn't need to handle any fields. This format can simply act like a sql table/database.

By specifying table frame it will become clear that the data is not timeseries/numeric or any other known formats. Also it is clear that the data require some post processing due to the presence of labels.

Looking for feedback.

@yesoreyeram yesoreyeram requested review from kylebrandt and a team May 17, 2023 09:49
### Properties

- By default, it is single frame. If multiple frames present, all frame names have to be unique
- All field names must be unique to its frame. (No duplicate field names allowed within the frame)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the unique name requirements should perhaps be removed. At least in terms of table responses from SQL, something like Select 1 as "A", 2 AS "A", although odd, is valid.

To work with data like this in terms of manipulation we would need positional/ordinal selectors which we generally don't have now. But it seems like validate that would be at the time of input to an operation.

Do you have any different use cases for these formats (e.g. when would a datasource author attach which format to the frame?(I imagine perhaps based on a query option, so why would a user pick one over the other?)


- There can be multiple frames
- Field name can be duplicate within frame. If duplicate field names found, they must be distinguished by labels
- Fields can have labels
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What might a labels on a field mean in the table case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants