I am getting one issue on one of my script which is working for other windows

I am attaching the image of it and any one can help me let me know.

Please post the text of the scripts so we don't have to type them out again. Format them correctly using the </> button.

  1. As @Transistor suggested: we need the code, not a picture (though pictures of the stacktrace are great when you can't copy the stacktrace). At least some of your code is cut off in the screenshot, so I can't see what you're supplying for the aggregationModes kwarg.
  2. Don't return different value types based on conditions; your if block returns an empty list/array, while your else block returns a DataSet.

Thank you a lot.