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

BDRSPS-1068 Add custom string field to treat whitespace-only cells as empty #349

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

Lincoln-GR
Copy link
Contributor

@Lincoln-GR Lincoln-GR commented Nov 28, 2024

This custom field is set to override the default frictionless string field.
It converts whitespace-only cells to the empty string before the regular frictionless validation/checks occur.

This means that

  1. a required field will error when supplied with a whitespace-only cell.
  2. All strings fields will appear an None when mapping, when their cell is whitespace-only (i.e. behave the same as an empty cell)

@joecrowleygaia
Copy link
Collaborator

LGTM. Should update README.md maybe since it is changing how frictionless string schema field behaves. Anyone that's new to project might get caught out chasing things when string ain't doing what they expect it do from the frictionless docs.

Copy link
Collaborator

@joecrowleygaia joecrowleygaia left a comment

Choose a reason for hiding this comment

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

comment left

Comment on lines +96 to +106
## Frictionless

The project uses the [Frictionless Framework](https://framework.frictionlessdata.io/) to validate and read the
template CSV files.
We have a number of plugins defined in the [`/abis_mapping/plugins`](/abis_mapping/plugins) directory which
customize and extend how Frictionless works.

### Overridden String Field Class

In particular, we have the [`abis_mapping/plugins/string_customized.py`](/abis_mapping/plugins/string_customized.py)
plugin which overrides the default Frictionless string field to use our custom class.
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@joecrowleygaia joecrowleygaia merged commit 2809657 into main Nov 28, 2024
9 checks passed
@joecrowleygaia joecrowleygaia deleted the BDRSPS-1068 branch November 28, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants