Spotfire Data Table Sort

I connect to Impala. In Spotfire I have a query with 2 inner joins and an order by clause on the outer query. The query returns sorted data when run directly on the db but in Spotfire, the resulting data table from the query is not sorted.

There is an IronPython script that runs on the sorted data table. As far as I can tell, sorting the table using Properties > Sorting only sorts the visualization and the underlying data table is still the original table. So when the script iterates through the rows, it still gets only original data and not the sorted data.

Is there any way to get data into Spotfire sorted as specified in the query?
Is there a way in script or otherwise to sort the actual data table to match the visualization?