Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

Errors when calling deployed custom python endpoint

Level 1
Errors when calling deployed custom python endpoint

I've made custom python code that i need to deploy as an api endpoint on my company's dataiku instance. I've tested it in the Api Designer, though each time i've tested it with the sample code in the deployer, i either get:

Unknown error on command (HTTP code:301)   <html><head><title>301 Moved Permanently</title></head><body>

<center><h1>301 Moved Permanently</h1></center></body></html>


dataikuapi.utils.DataikuException: Failed to run function : <class 'TypeError'> : api_py_function() missing 1 required positional argument: 'param1'


To make sure theres not an issue with the code i deployed, i tried deploying the sample code:

def api_py_function(param1):
     return param1

The test code generated by dataiku:

client = dataikuapi.APINodeClient("", "address_match")

result = client.run_function("test_function",
param1 = "paramValueToReplace")
print("Function result: %s" % result.get("response"))


and I still get these issues. How can i resolve these issues

0 Kudos
1 Reply

Hi @benh,

Thank you for the details, and indeed your test using a test deployment and testing out the sample code snippet from the "Sample code" is a great way to test if you are hitting the right endpoint.

Sorry to hear that the issue still persists though! To start with, I think that we could help the most if you open a support ticket and attach a diagnostic of the instance that houses your API deployer along with the name of the API endpoint. Then we can go from there. 


0 Kudos