Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/utils/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ test('datastore data dictionary => tableschema', t => {
t.deepEqual(result, expected)

result = utils.dataStoreDataDictionaryToTableSchema({
id: 'column',
id: 'Column',
type: 'text',
info: {
title: 'Column',
Expand All @@ -224,7 +224,7 @@ test('datastore data dictionary => tableschema', t => {
})

expected = {
name: 'column',
name: 'Column',
type: 'string',
title: 'Column',
constraints: {
Expand Down
1 change: 1 addition & 0 deletions utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ module.exports.dataStoreDataDictionaryToTableSchema = (dataDictionary) => {
type: dataDictionaryType2TableSchemaType[dataDictionary.type] || 'any'
}
if (dataDictionary.info) {
field.name = dataDictionary.info.title || dataDictionary.id
Copy link
Member

Choose a reason for hiding this comment

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

@sagargg this looks wrong to me. name is the identifier in tableschema so it should be equal to dataDictionary.id, while title is the different thing.

const constraintsAttributes = ['required', 'unique', 'minLength', 'maxLength', 'minimum', 'maximum', 'pattern', 'enum']
field.constraints = {}
Object.keys(dataDictionary.info).forEach(key => {
Expand Down