function-buildpacks-for-knative icon indicating copy to clipboard operation
function-buildpacks-for-knative copied to clipboard

Python invoker throws exception when the function returns just data without attributes

Open andrew-su opened this issue 2 years ago • 0 comments

Bug Report

Running a function that expects cloudevents where after processing returns only the body will cause it to throw an exception.

Expected Behavior

No errors + proper attributes are returned.

Steps to Reproduce the Bug

  1. Define a function:
    from typing import Any
    
    def main(data: Any, attributes: dict):
        # Your function implementation goes here
        return data
    
  2. Run this function with the Python invoker.
  3. Send a CE via curl to function.

andrew-su avatar May 16 '22 17:05 andrew-su