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

Rebase da1660d: 'missing value per field pattern' #714

Merged
merged 1 commit into from
Dec 15, 2020
Merged
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
59 changes: 59 additions & 0 deletions patterns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,3 +965,62 @@ re-packaged using these formats.
To keep the implementation and testing testing: only one recursive level is
possible. A `resource` can list `resources` inside (like in the example). But
the inner resources cannot contain resources again.

## Missing values per field

### Overview

Characters representing missing values in a table can be defined for all fields in a [Tabular Data Resource](http://frictionlessdata.io/specs/tabular-data-resource/) using the [`missingValues`](http://frictionlessdata.io/specs/table-schema/#missing-values) property in a Table Schema. Values that match the `missingValues` are treated as `null`.

The Missing values per field pattern allows different missing values to be specified for each field in a Table Schema. If not specified, each field inherits from values assigned to `missingValues` at the Tabular Data Resource level.

For example, this data...

item | description | price
---- | ----------- | -----
1 | Apple | 0.99
tba | Banana | -1
3 | n/a | 1.20

...using this Table Schema...

```javascript
"schema":{
"fields": [
{
"name": "item",
"title": "An inventory item number",
"type": "integer"
},
{
"name": "description",
"title": "item description",
"type": "string",
"missingValues": [ "n/a"]
},
{
"name": "price",
"title": "cost price",
"type": "number",
"missingValues": [ "-1"]
}
],
"missingValues": [ "tba", "" ]
}
```

...would be interpreted as...

item | description | price
------ | ----------- | ------
1 | Apple | 0.99
`null` | Banana | `null`
3 | `null` | 1.20

### Specification

A field MAY have a `missingValues` property that MUST be an `array` where each entry is a `string`. If not specified, each field inherits from the values assigned to [`missingValues`](http://frictionlessdata.io/specs/table-schema/#missing-values) at the Tabular Data Resource level.

### Implementations

None known.