Open afoda opened 5 years ago
Can I take this?
I don't think the JSON table schema specifies anything about the index:
https://pre-v1.frictionlessdata.io/json-table-schema/#schema
Could maybe argue the index could be represented as primaryKey
s but let's see what others think
We write it as the primaryKey when it's unique
The schema field also contains a primaryKey field if the (Multi)index is unique.
from https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#table-schema
Ah thanks Tom. Any chance you know the history of that requirement? Is it because primary keys in databases are typically unique?
The JSON table schema doesn't require uniqueness for primary keys and that actually gets controlled by a unique constraint in the schema:
https://pre-v1.frictionlessdata.io/json-table-schema/#field-constraints
Was discussed in the issue to add it there as well:
https://github.com/dataprotocols/dataprotocols/issues/21
So this seems like it could be supported
Huh, I read it as needing to be unique: https://pre-v1.frictionlessdata.io/json-table-schema/#primary-key
A primary key is a field or set of fields that uniquely identifies each row in the table.
But I may be wrong.
Code Sample, a copy-pastable example if possible
Output:
Problem description
I would expect the json roundtrip to output a dataframe that is identical to the input, regardless of the value of the orient parameter.
Expected Output
Output of
pd.show_versions()