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

Fixing formatting of partial references #7 #8

Closed
wants to merge 1 commit into from

Conversation

antirotor
Copy link

This is fix for formatting partial references formatted in invalid way.

Say we have:

data = {"FOO": "bar", "BAZ": "{FOO}", "X": "{Y[z]}"}

result of acre.compute() should ideally be:

>>> acre.compute(data)
{'FOO': 'bar', 'BAZ': 'bar', 'X': '{Y[z]}'}

Although X can be legitimate value in environment variable, formatting it will fail because it triggers python formatting function expecting it references list with z as indice and indices must be ints.

Solution is to try the original way and if it fails, format each reference separately and if one of them fails, return unformatted value.

Resolves #7

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.

unsolved token crash
1 participant