-
Notifications
You must be signed in to change notification settings - Fork 121
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] HOCONConverter relativedelta as value #246
Comments
P.S. Also I don't see any tag corresponding to versions above 0.3.54 in this repo. Can you add them, please? |
@darthbear Could you check it please? |
#263 is a step towards fixing this issue, but it does not fully solve it: |
I think the main problem here is that, if I'm not mistaken, pyhocon does not keep the original document, but converts everything to what it believes to be the native data type, right when parsing. If conversion between data types is lossless, that's no problem (e.g. '1' -> 1 -> '1'), but in case of periods of time (or what looks like it), converting back does not work anymore. I think E.g. I might want to store a hash in a config that happens to contain only numbers and a letter at the end:
(The only option is to explicitly declare the value to be a string by enclosing it in "", but that may not be a valid thing to do in some use cases.) |
Thank you @ElkMonster, that's a precise issue description. Unfortunately, it looks like pyhocon's magic is not compatible with such an approach, so it will never be able to save files in a format some applications need. |
Moved to https://github.com/omry/omegaconf, it does support many features present in HOCON but it does not mess up with parsing date types |
Before 0.3.51:
After:
It's not possible to use result of such export in other languages/applications without custom config parsers.
IMHO the best option here is to add some option to parser to enable/disable such cast of config values.
The text was updated successfully, but these errors were encountered: