Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Merge 6f9f45b into 277b7ed
Browse files Browse the repository at this point in the history
  • Loading branch information
roll authored Apr 2, 2020
2 parents 277b7ed + 6f9f45b commit 3506800
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 5 deletions.
59 changes: 59 additions & 0 deletions data/datapackage-with-partial-dialect.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"profile": "tabular-data-package",
"name": "australian-open-data-portals",
"resources": [{
"profile": "tabular-data-resource",
"name": "open-data-portals",
"path": "data/australian-open-data-portals.tsv",
"encoding": "utf-8",
"format": "tsv",
"mediatype": "text/tsv",
"licenses": [{
"id": "CC-BY-4.0",
"title": "Creative Commons Attribution 4.0",
"url": "https://creativecommons.org/licenses/by/4.0/"
}],
"schema": {
"fields": [{
"name": "URL",
"type": "string",
"format": "uri",
"constraints": {
"required": true
}
}, {
"name": "Organisation",
"type": "string",
"format": "default"
}, {
"name": "Organisation type",
"type": "string",
"format": "default"
}, {
"name": "Portal",
"type": "string",
"format": "default"
}, {
"name": "Region",
"type": "string",
"format": "default"
}, {
"name": "Lat",
"type": "number",
"format": "default",
"decimalChar": ","
}, {
"name": "Lon",
"type": "number",
"format": "default",
"decimalChar": ","
}],
"missingValues": [""]
},
"primaryKeys": ["URL"],
"dialect": {
"delimiter": "\t",
"header": true
}
}]
}
15 changes: 13 additions & 2 deletions dist/datapackage-ui.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/datapackage-ui.min.js

Large diffs are not rendered by default.

Binary file modified dist/datapackage-ui.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/datapackage-ui.min.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/reducers/editorPackage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const uuidv4 = require('uuid/v4')
const { Schema } = require('tableschema')
const { Profile } = require('datapackage')
// TODO: it's not public on the datapackage level
const { DEFAULT_DIALECT } = require('datapackage/src/config')
const without = require('lodash/without')
const cloneDeep = require('lodash/cloneDeep')

Expand Down Expand Up @@ -201,6 +203,7 @@ const UPDATERS = {

// Processor

// TODO: why don't we use new Package() for normalization?
function processState(state) {
// Descriptor
state.descriptor.keywords = state.descriptor.keywords || []
Expand All @@ -213,6 +216,9 @@ function processState(state) {
if (resource.path instanceof Array) {
resource.path = resource.path[0]
}
if (resource.dialect) {
resource.dialect = { ...DEFAULT_DIALECT, ...resource.dialect }
}
resource.schema = resource.schema || {}
resource.schema.fields = resource.schema.fields || []
resource.schema._columns = resource.schema._columns || []
Expand Down

0 comments on commit 3506800

Please sign in to comment.