-
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
* migrate casting from callable objects to normal functions * migrate cast to date function * delete old test files * rename new test files * use new normal functions in get_casting_function() * linting * Move iso functions from callable objects to normal functions * bump version and add changelog * Fixes from review: @ChameleonTartu * Update changelog based on feedback from @ChameleonTartu * Do major version bump and update changelog
- Loading branch information
1 parent
47d85f2
commit 14ac652
Showing
16 changed files
with
596 additions
and
603 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 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import Callable | ||
|
||
from returns.result import safe | ||
|
||
from kaiba.casting._cast_to_date import cast_to_date | ||
from kaiba.casting._cast_to_decimal import cast_to_decimal | ||
from kaiba.casting._cast_to_integer import cast_to_integer | ||
from kaiba.models.casting import CastToOptions | ||
|
||
|
||
@safe | ||
def get_casting_function(cast_to: CastToOptions) -> Callable: | ||
"""Return casting function depending on name.""" | ||
if cast_to == CastToOptions.INTEGER: | ||
return cast_to_integer | ||
|
||
elif cast_to == CastToOptions.DECIMAL: | ||
return cast_to_decimal | ||
|
||
return cast_to_date |
Oops, something went wrong.