Skip to content

Commit

Permalink
πŸ“ Simplify example of registering a custom transform
Browse files Browse the repository at this point in the history
  • Loading branch information
ducdetronquito committed Oct 20, 2022
1 parent ecadc5a commit c29ba33
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ class GuidConverter(magicparse.Converter):

magicparse.register(GuidConverter)

schema = Schema.build(
{
"file_type": "csv",
"fields": [{"key": "shop-guid", "type": "guid", "column-number": 1}],
}
)

rows, errors = schema.parse("13ec10cc-cc7e-4ee9-b091-9caa6d11aeb2")
schema = {
"file_type": "csv",
"fields": [
{"key": "shop-guid", "type": "guid", "column-number": 1}
],
}

rows, errors = magicparse.parse("13ec10cc-cc7e-4ee9-b091-9caa6d11aeb2", schema)
assert rows == [{"shop-guid": "13ec10cc-cc7e-4ee9-b091-9caa6d11aeb2"}]
assert not errors
```
Expand Down

0 comments on commit c29ba33

Please sign in to comment.