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

fix(validators): Stop converting default when is_type_of is set to str #1066

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

rochacbruno
Copy link
Member

When a validator defines both is_type_of=str, default="0.30" the validation process SHOULD NOT convert the default to a float, so the current solution was to bypass toml by adding extra quotes.

NOTE: Future solution, in 4.0.0 will be to decouple defaults declaration from validation declaration, and completely remove the tomlfy function

fix: #1064

When a validator defines both `is_type_of=str, default="0.30"` the
validation process SHOULD NOT convert the default to a float, so
the current solution was to bypass toml by adding extra quotes.

NOTE: Future solution, in 4.0.0 will be to decouple defaults declaration
from validation declaration, and completely remove the tomlfy function

fix: #1064
Copy link

netlify bot commented Mar 1, 2024

Deploy Preview for dynaconf ready!

Name Link
🔨 Latest commit 7737fb9
🔍 Latest deploy log https://app.netlify.com/sites/dynaconf/deploys/65fda4bc8b04d00009472a35
😎 Deploy Preview https://deploy-preview-1066--dynaconf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rochacbruno rochacbruno added this to the 3.3.0 milestone Mar 1, 2024
@rochacbruno rochacbruno marked this pull request as draft March 1, 2024 14:54
Copy link
Contributor

github-actions bot commented Mar 1, 2024

Test Results (Python 3.11)

475 tests  ±0   475 ✔️ ±0   33s ⏱️ -4s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 7737fb9. ± Comparison against base commit 7bf799c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Mar 1, 2024

Test Results (Python 3.8)

475 tests  ±0   475 ✔️ ±0   33s ⏱️ -2s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 7737fb9. ± Comparison against base commit 7bf799c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Mar 1, 2024

Test Results (Python 3.10)

475 tests  ±0   475 ✔️ ±0   34s ⏱️ -2s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit 7737fb9. ± Comparison against base commit 7bf799c.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.75%. Comparing base (7bf799c) to head (7737fb9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1066   +/-   ##
=======================================
  Coverage   98.75%   98.75%           
=======================================
  Files          23       23           
  Lines        2248     2248           
=======================================
  Hits         2220     2220           
  Misses         28       28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rochacbruno rochacbruno marked this pull request as ready for review March 22, 2024 15:26
@pedro-psb pedro-psb merged commit b528e92 into master Mar 22, 2024
50 checks passed
@pedro-psb pedro-psb deleted the 1064 branch March 22, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator default string parsed to number
2 participants