-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can't tell what starlark Builtin cannot be converted to Python #143
Comments
Can you share the Starlark that triggers this as well? |
It looks like you're trying to return a reference to a function somehow? A Builtin is a Go function that is callable from Starlark. I'd like for this module to support returning Callables back to Python but it doesn't at this time. |
I introduce a
and this is the minimum reproduction: def stage_slack_notify(stage_names):
return {"name": "slack", "needs": stage_names}
def main(ctx):
build_stages = {"something": [], "something_else": []}
stages = [build_stages] + [stage_slack_notify(build_stages.keys)]
final = {
'version': '1',
'stages': stages,
}
print(final)
return final Can you spot the error?
But I still feel like there's a better way to communicate the error, perhaps by telling exactly what wasn't able to be converted, with some path to it if possible. |
Keeping track of the path to the value would be doable but maybe kinda ugly. I think we'd have to add a |
- Subclass into ConversionToPythonFailed and ConversionToStarlarkFailed - Make messages much more informative and indicate which key or index failed - If conversion fails because of a Python exception, add that exception as the source of ours Closes #143
- Subclass into ConversionToPythonFailed and ConversionToStarlarkFailed - Make messages much more informative and indicate which key or index failed - If conversion fails because of a Python exception, add that exception as the source of ours Closes #143
- Subclass into ConversionToPythonFailed and ConversionToStarlarkFailed - Make messages much more informative and indicate which key or index failed - If conversion fails because of a Python exception, add that exception as the source of ours Closes #143
* Make ConversionErrors more useful - Subclass into ConversionToPythonFailed and ConversionToStarlarkFailed - Make messages much more informative and indicate which key or index failed - If conversion fails because of a Python exception, add that exception as the source of ours - Fix some minor issues in starlark.c documentation while we're there Closes #143
I can't tell which property of the final output of my Starlark script is not convertible.
Test code:
The test code is working with simple dictionaries so it might be something else fancier I'm (unknowingly) doing that's not resolving to something convertible.
The text was updated successfully, but these errors were encountered: