Originally created by @pauloborges on GitHub (Oct 26, 2024).
Example file:
cat file.pkl
field {
key = "value"
}
Evaluating the whole file works as expected:
pkl eval -f yaml file.pkl
field:
key: value
But evaluating an expression ignores the format argument:
pkl eval -f yaml -x field file.pkl
new Dynamic { key = "value" }
Originally created by @pauloborges on GitHub (Oct 26, 2024).
Example file:
```
cat file.pkl
field {
key = "value"
}
```
Evaluating the whole file works as expected:
```
pkl eval -f yaml file.pkl
field:
key: value
```
But evaluating an expression ignores the format argument:
```
pkl eval -f yaml -x field file.pkl
new Dynamic { key = "value" }
```
This is currently expected behavior and not a bug, but this is definitely a valid feature request. You can emulate the desired behavior using -x 'output.renderer.renderValue(<expr>).
@HT154 commented on GitHub (Oct 27, 2024):
This is currently expected behavior and not a bug, but this is definitely a valid feature request. You can emulate the desired behavior using `-x 'output.renderer.renderValue(<expr>)`.
You can see how the output format selection is implemented here, which might help explain what's happening here: https://github.com/apple/pkl/blob/466ae6fd4c72aa7ccabde970131eccbc2a690b12/stdlib/base.pkl#L93-L107
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @pauloborges on GitHub (Oct 26, 2024).
Example file:
Evaluating the whole file works as expected:
But evaluating an expression ignores the format argument:
@HT154 commented on GitHub (Oct 27, 2024):
This is currently expected behavior and not a bug, but this is definitely a valid feature request. You can emulate the desired behavior using
-x 'output.renderer.renderValue(<expr>).You can see how the output format selection is implemented here, which might help explain what's happening here: https://github.com/apple/pkl/blob/466ae6fd4c72aa7ccabde970131eccbc2a690b12/stdlib/base.pkl#L93-L107
@ThinkChaos commented on GitHub (Jan 17, 2025):
The workaround above doesn't work, it should be
-x 'module.output.renderer.renderValue(<expr>)