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

Implement blank_none option, satisfying #35 #56

Merged
merged 7 commits into from
Oct 15, 2024

Conversation

smt5541
Copy link
Collaborator

@smt5541 smt5541 commented Oct 7, 2024

🛠 Changes being made

Give examples of the changes you've made in this pull request. Include an itemized list if you can.

  • Added FPV_BLANK_NONE configuration option, which is handled as False if not set
  • Added blank_none parameter to Parameter constructor, which defaults to FPV_BLANK_NONE if not set, determines if an empty string passed to an Optional[str] parameter will be converted to None
  • Rewrote handling of Optional, as implementing blank_none broke the existing implementation

🧠 Rationale behind the change

Why did you choose to make these changes?

  • These changes were requested in issue Conversion of empty string to None #35, and developers familiar with certain other languages and frameworks may be used to receiving null in place of an empty string, so this option could help those developers use this library more smoothly

Does this pull request resolve any open issues?

Closes #35

Were there any trade-offs you had to consider?

🧪 Testing

  • [ X ] Have tests been added or updated for the changes introduced in this pull request?

  • [ X ] Are the changes backwards compatible?

If the changes aren't backwards compatible, what other options were explored?

✨ Quality check

  • [ X ] Are your changes free of any erroneous print statements, debuggers or other leftover code?

  • [ X ] Has the README been updated to reflect the changes introduced (if applicable)?

💬 Additional comments

@smt5541 smt5541 added the enhancement New feature or request label Oct 7, 2024
@smt5541 smt5541 requested a review from Ge0rg3 October 7, 2024 01:50
@smt5541 smt5541 self-assigned this Oct 7, 2024
@smt5541 smt5541 linked an issue Oct 7, 2024 that may be closed by this pull request
@Ge0rg3
Copy link
Owner

Ge0rg3 commented Oct 15, 2024

Looks great 😄

@Ge0rg3 Ge0rg3 merged commit cb5cbd4 into master Oct 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conversion of empty string to None
3 participants