Repository navigation
Name the UDF signatures found when no UDF matches - #980
Closed
sandeshbagmare wants to merge 1 commit into
Closed
sandeshbagmare wants to merge 1 commit into
sandeshbagmare wants to merge 1 commit into
Conversation
A UDF whose entrypoint is named correctly but leaves out the type annotations, as in 'def apply_datacube(cube, context)', only produced 'No UDF found.', which does not say which part of the signature was wrong. Collect the name and signature of every function the UDF code defines and include them in the exception, together with a pointer to the reference for UDF function names and signatures. Types the execution context pre-loads, like UdfData, are callable but are never entrypoints, so they are skipped. Fixes Open-EO#545
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #545
When the arguments of the entrypoint do not match a supported UDF signature,
run_udf_codeonly saidNo UDF found.. The most common cause is a correct function name with the type annotations left out (def apply_datacube(cube, context)), which reads as a broken UDF library rather than a broken signature.Proposed Changes
UdfData,XarrayDataCube, ...). They are callable, but never entrypoints, and would otherwise dominate the message.Before:
After, for a UDF that defines
def apply_datacube(cube, context):Tests
Two cases added to
tests/udf/test_run_code.py: one for a function that is named correctly but unannotated, one for code that defines no function at all.pytest tests/udfpasses (124 passed, 6 skipped). The wider suite has pre-existing failures intests/utils/test_http.pyand the S3 extra that are unrelated to this change and also fail onmasterhere.