Skip to content

Null values are not validated and cast correctly #133

@baalmael

Description

@baalmael

Field.checkConstraintViolations currently returns a pattern violation even when the field:

  • is not required, and
  • the actual value is null,
  • but the schema defines a pattern constraint.

Also for json fields (such as array), null values cause an NPE even when the field is not required

io.frictionlessdata.tableschema.exception.InvalidCastException: java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "string" is null

	at io.frictionlessdata.tableschema.field.Field.castValue(Field.java:674)

This behavior seems wrong to me and it is inkonsistent with the python implementation. I am happy to work on a fix and create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions