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

[bug] string with yaml tag is automatically converted to other type if possible #32

Open
valentingol opened this issue May 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@valentingol
Copy link
Owner

valentingol commented May 15, 2023

When a parameter is tagged with a yaml tag and contain a string that can be interpreted as an other type, this string is automatically converted to the other type:
E:g:

config:
  param: !tag "True"
  param2: !tag "2.3"

It is converted to {"config": {"param@tag": True, "param2@tag": 2.3}}

To solve this, use cliconfig tags:

config:
  param@tag: "True"
  param2@tag: "2.3"

It is converted to {"config": {"param@tag": "True", "param2@tag": "2.3"}}

Source of the behavior: https://github.com/valentingol/cliconfig/blob/main/cliconfig/yaml_tags/_yaml_tags.py, line 53

@valentingol valentingol changed the title [bug] yaml tagged string convert to other type [bug] yaml tagged string automatically converted to other type May 15, 2023
@valentingol valentingol added the bug Something isn't working label May 15, 2023
@valentingol valentingol changed the title [bug] yaml tagged string automatically converted to other type [bug] string with yaml tag is automatically converted to other type if possible May 15, 2023
@valentingol valentingol reopened this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant