[IGN-14447]system.dataset.toExcel not working after updating to 8.3

Hi Guys,

First post.

After updating to 8.3 I'm getting a can’t convert to common.dataset error on my system.dataset.toExcel scripts. It worked before updating.

The below screenshot is just an example I made to test, normally its a button with a script that downloads the excel file but it’s the exact same error.

If I change the script to system.dataset.toCSV it works fine.

Is this a bug in 8.3 or am I doing something wrong?

So, the short version is:
Update your script to system.dataset.toExcel(True, [value]) and everything will start working fine.

The medium version is that toExcel has always been documented to accept a list of datasets (which will become 'sheets' in the final document, 1:1 with input datasets). That it accepts a single dataset is a convenience feature we're deliberately not documenting because the list form is "more correct".

The long version is that this broke with the transition to 8.3 because dataset instances now automatically appear as "PyDatasets" to scripting. PyDatasets are true Python "sequence" types, so the internal check inside toExcel follows the "this is a sequence" path (and fails when the inner objects are rows, not full datasets) instead of the previous "this is a single value" path (which would then get used as a single dataset).
We're going to fix it internally, so that a single dataset is still allowed through toExcel, but it won't happen particularly quickly, so you'll want to go with a workaround for now. Luckily, it's trivial; by wrapping the (Py)Dataset you're passing in a list, you're guaranteeing you follow the "list of values" code path internally and get the right result.

2 Likes