from typing import OrderedDict


def make_ordered_to_dict(sorted_columns, include_timestamp):
    """Make a row dict for sorted column results from scans."""
    od = OrderedDict()
    for column in sorted_columns:
        if include_timestamp:
            value = (column.cell.value, column.cell.timestamp)
        else:
            value = column.cell.value
        od[column.columnName] = value
    return od