Closed Stephen-Gates closed 7 years ago
type-error
(by @roll)type-or-format-error
"message": "Row {row_number} has a value {value} in column {column_number} that does not match the expected type or format (Expected type: {field_type} - Expected format: {field_format})"
Should this be broken down into:
type-error
format-error
As we already break down the constraint errors.
@roll @danfowler @Stephen-Gates ?
I think breaking it down would be helpful
It looks like there is already a format-error
for the source
type.
@danfowler correct. we can change the wording now, before we ship v1.
Isn't the format error for files in the wrong format (.txt vs .csv)?
Isn't the format error for files in the wrong format (.txt vs .csv)?
yes. so we need an alternative for format in the sense of format of a "primitive" type for a value.
Breaking it down is just not possible AFIAK. That's the reason why non-castable-value
has appeared at the first place.
For example we have a field descriptor:
name: name
type: date
format: %Y/%m
And having a value 2005/06/07
we just can say that it's not compliant to this field. Not enough information to say is type should be a string (bad type) or format should be fixed (bad format).
For numbers there are also field options like decimalChar
comes to play when you could have proper type, proper format but still non-castable-value
(and again it seems without a way to clarify the reason).
So type-error
or type-[or-]format-error
may be?
type-or-format-error
Currently:
"message": "Row {row_number} has non castable value {value} in column {column_number} (type: {field_type}, format: {field_format})",
"description": "The value can't be cast based on the schema type and format for this field.\n\n How it could be resolved:\n - If this value is not correct, update the value.\n - If this error should be ignored disable non-castable-value
check in {validator}. In this case all schema checks for row values will be ignored."
Proposed:
type-or-format-error
"message": "The value {value} in row {row_number} and column {column_number} is not (type: {field_type}, format: {field_format})",
"description": "The value does not match the schema type and format for this field.\n\n How it could be resolved:\n - If this value is not correct, update the value.\n - If this value is correct, adjust the type and/or format."
You could append "\n To ignore the error, disable the non-castable-value
check in {validator}. In this case all schema checks for row values will be ignored." however this may be meaningful in every context.
The meaning of "non castable" in this error message is not clear to non-technical users. Consider using simpler language. e.g. The value does not match the type and format in the schema.