-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
JSON and Fixed Width argument group and parser support. #1247
Merged
fcurella
merged 15 commits into
joke2k:master
from
johnbrandborg:feature/json-fw-argument-group-support
Aug 19, 2020
Merged
JSON and Fixed Width argument group and parser support. #1247
fcurella
merged 15 commits into
joke2k:master
from
johnbrandborg:feature/json-fw-argument-group-support
Aug 19, 2020
Conversation
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
* Add safe_domain_name() to Internet Provider * Apply DRY to safe domain generation * Add a test for safe email generation
some grammar fix
* 💂 Fix max_value/positive pyfloat interaction When pyfloat(max_value=100, positive=True) is called, it sometimes returns negative numbers, which is unexpected. To fix it, we just need to "cap" our internal minimum value to zero. This does leave `pyfloat(max_value=100, min_value=-100, positive=True)` as a call that secretly moves the min_value up to 0 though. Fixes #1212. * 💥 Forbid pyfloat call with incompatible arguments `pyfloat(positive=True, min_value=-1)` will now throw a ValueError, since the combination of a request for a positive number, yet a negative minimum value is probably not what the caller intended.
* Add ja_JP kana_names * Reformat and Add links * fix PEP8
* Builder module * Move to Misc as Methods * Allow JSON to produce single entry * json and fixed_width tests * Improved structure creation and tests * correcting E231 * Value only lists * fix E303 * Improved docstrings
Nice work! Thank you! ✨ |
IlfirinPL
pushed a commit
to IlfirinPL/faker
that referenced
this pull request
Apr 9, 2021
* Extend Person Provider to support nonbinary suffixes and prefixes (joke2k#1206) * Implement nonbinary Person Provider * Address flake8 and isort findings * Fix import ordering in tests * Add tests for en Provider to test preexisting suffix scenario * Refine tests for en Provider * Close joke2k#1208. Update setup.py `python_requires` * Add safe domain names (joke2k#1209) * Add safe_domain_name() to Internet Provider * Apply DRY to safe domain generation * Add a test for safe email generation * Update __init__.py (joke2k#1217) some grammar fix * 💂 Fix max_value/positive pyfloat interaction (joke2k#1218) * 💂 Fix max_value/positive pyfloat interaction When pyfloat(max_value=100, positive=True) is called, it sometimes returns negative numbers, which is unexpected. To fix it, we just need to "cap" our internal minimum value to zero. This does leave `pyfloat(max_value=100, min_value=-100, positive=True)` as a call that secretly moves the min_value up to 0 though. Fixes joke2k#1212. * 💥 Forbid pyfloat call with incompatible arguments `pyfloat(positive=True, min_value=-1)` will now throw a ValueError, since the combination of a request for a positive number, yet a negative minimum value is probably not what the caller intended. * Update bban_format for country FI (joke2k#1220) Fixes joke2k#1219. * Fix person.ja_JP kana and roman characters (joke2k#1221) * Add ja_JP kana_names * Reformat and Add links * fix PEP8 * JSON and Fixed_Width Structures (joke2k#1223) * Builder module * Move to Misc as Methods * Allow JSON to produce single entry * json and fixed_width tests * Improved structure creation and tests * correcting E231 * Value only lists * fix E303 * Improved docstrings * Add Argument Group references * Add Argument Group and Parser Support * Fixed handing of integers and floats * Addressed Flake8 findings * Better Examples and Samples Co-authored-by: Cory Donnelly <[email protected]> Co-authored-by: Flavio Curella <[email protected]> Co-authored-by: Pavel E. Petrov <[email protected]> Co-authored-by: coiax <[email protected]> Co-authored-by: ALMP-SallaH <[email protected]> Co-authored-by: Yohei Ema <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this changes
The new Argument Groups is a much cleaner way to handle parsing arguments to provider methods when building data structures like DSV, JSON and Fixed Width. It also allows for the JSON provider to now accept a Dictionary that utilizes the Argument Groups, which is a much simpler way to build complex data structures.
If string tokens are used then complex Strings can be created by using pystr_format under the hood.
All previous support for lists with tuple records is still in tacked and will not be broken. More tests have been added to ensure absolutely safety for anyone that begins to use JSON with list format or dict format, and Fixed Width generation.