Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jeremy_fourman
Creator
Creator

get_arguments() takes 4 positional arguments but 5 were given

Hello -

We are wanting to test full script support to enable our data science team to do some cool stuff! 🙂

I have worked through all the pieces and been reading all the documentation available - thank you all who contribute!!

I decided on using the following as a starting point for our work.

https://github.com/qlik-oss/server-side-extension/tree/master/examples/python/fullscriptsupport

However in testing the example - I receive during load the following error.

'The following error occurred:

Connector reply error: grpc::StatusCode::UNKNOWN: 'Exception iterating responses: get_arguments() takes 4 positional arguments but 5 were given''
 
I have validated the method and call definitions match within ScriptEval. Compared my code against example code etc.
 
Not sure where to head next - would be glad to know if anyone else has encountered this. I feel like I am missing something small or that maybe it is a gRPC issue?
 
For reference here is the line that fails:
params = self.get_arguments(context, arg_types, row.duals, header)
 
And the method definition:
def get_arguments(context, arg_types, duals, header):
 
 
Thank you.
Jeremy
Labels (1)
1 Solution

Accepted Solutions
jeremy_fourman
Creator
Creator
Author

A little research and coffee made me understand that self was being passed as the additional argument to the function.

That made me go hmmmm and look at the function definition again compared to the example. I forgot to tag it static.

So the correct definition was

@staticmethod    
def get_arguments(context, arg_types, duals, header):

Now we are able to start testing!

Thanks.

 

View solution in original post

1 Reply
jeremy_fourman
Creator
Creator
Author

A little research and coffee made me understand that self was being passed as the additional argument to the function.

That made me go hmmmm and look at the function definition again compared to the example. I forgot to tag it static.

So the correct definition was

@staticmethod    
def get_arguments(context, arg_types, duals, header):

Now we are able to start testing!

Thanks.