-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* updates dev dependencies * Types out the schema as pydantic BaseModels * process now marshalls to pydantic * If statements migrated to pydantic * Slicing migrated to pydantic * Regexp migrated to pydantic * Casting migrated to pydantic * Fixes doctests in functions.py * Handler.handle_mapping migrated to pydantic * Handlers.handle_attributes merged to pydantic * Possibly done migrating mapper code to pydantic * Migrates collection handlers to pydantic * Migrates collection handlers tests to pydantic * Migrates process function to pydantic * fix process function so that it correctly returns a Failure(Exc) * Add validation test that checks that the errors we get are correct and that things a marshalled correctly * removes old jsonschema tests * removes unused common.py and gets tests coverage up to 100% again * Fixes linting errors * cleans up constants.py * Fixes mypy errors * Fixes import sort * fixes high jonas complexity lines * in function stop using mapvalue and use same AnyType type that's used in pydantic schema * fixes linting errors * removes unused import * Removes jsonschema dependency * formatting * Bump minor version * Test that we can create a jsonschema * Adds docstring.
- Loading branch information
1 parent
a5ad9e7
commit 07295dd
Showing
49 changed files
with
1,051 additions
and
1,481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,20 @@ | ||
from typing_extensions import Final | ||
|
||
# Objects | ||
NAME = 'name' | ||
ARRAY: Final = 'array' | ||
ITERABLES: Final = 'iterables' | ||
|
||
ATTRIBUTES: Final = 'attributes' | ||
OBJECTS: Final = 'objects' # noqa: WPS110 | ||
BRANCHING_OBJECTS: Final = 'branching_objects' | ||
BRANCHING_ATTRIBUTES: Final = 'branching_attributes' | ||
|
||
MAPPINGS: Final = 'mappings' | ||
SEPARATOR: Final = 'separator' | ||
IF_STATEMENTS: Final = 'if_statements' | ||
CASTING: Final = 'casting' | ||
DEFAULT: Final = 'default' | ||
|
||
# Iterables | ||
ALIAS: Final = 'alias' | ||
PATH: Final = 'path' | ||
|
||
# Mapping | ||
# 'path' from iterables | ||
# 'default' | ||
|
||
# Regexp | ||
REGEXP: Final[str] = 'regexp' | ||
SEARCH: Final[str] = 'search' | ||
GROUP: Final[str] = 'group' | ||
DEFAULT_GROUP: Final[int] = 0 | ||
|
||
# IF STATEMENT | ||
CONDITION: Final = 'condition' | ||
IS: Final = 'is' | ||
IN: Final = 'in' | ||
NOT: Final = 'not' | ||
CONTAINS: Final = 'contains' | ||
TARGET: Final = 'target' | ||
THEN: Final = 'then' | ||
OTHERWISE: Final = 'otherwise' | ||
|
||
# Slicing | ||
SLICING: Final = 'slicing' | ||
FROM: Final = 'from' | ||
TO: Final = 'to' | ||
|
||
# Casting | ||
# 'to' from slicing | ||
INTEGER: Final = 'integer' | ||
DECIMAL: Final = 'decimal' | ||
DATE: Final = 'date' | ||
ORIGINAL_FORMAT: Final = 'original_format' | ||
INTEGER_CONTAINING_DECIMALS = 'integer_containing_decimals' | ||
INTEGER_CONTAINING_DECIMALS: Final[str] = 'integer_containing_decimals' | ||
YMD_DATE_FORMAT: Final = r'(^(yy|yyyy)[^\w]?mm[^\w]?dd$)' | ||
DMY_DATE_FORMAT: Final = r'(^dd[^\w]?mm[^\w]?(yy|yyyy)$)' | ||
MDY_DATE_FORMAT = r'(^mm[^\w]?dd[^\w]?(yy|yyyy)$)' | ||
MDY_DATE_FORMAT: Final = r'(^mm[^\w]?dd[^\w]?(yy|yyyy)$)' | ||
|
||
# Casting helpers | ||
COMMA: Final[str] = ',' | ||
PERIOD: Final[str] = '.' | ||
EMPTY: Final[str] = '' | ||
|
||
# ISO | ||
ALPHA_TWO = 'alpha_2' | ||
ALPHA_THREE = 'alpha_3' | ||
NUMERIC = 'numeric' | ||
OFFICIAL_NAME = 'official_name' | ||
INVALID = 'invalid' | ||
# NAME | ||
NAME: Final[str] = 'name' | ||
ALPHA_TWO: Final[str] = 'alpha_2' | ||
ALPHA_THREE: Final[str] = 'alpha_3' | ||
NUMERIC: Final[str] = 'numeric' | ||
OFFICIAL_NAME: Final[str] = 'official_name' | ||
INVALID: Final[str] = 'invalid' |
Oops, something went wrong.