This function should order the dataset based on the provided key. The key should be an attribute that exists within the data class; if it does not, an appropriate error should be raised. By default, the dataset should be ordered in ascending order; however, if the key is prefixed with a '-', the dataset should be ordered in descending order.
This function should order the dataset based on the provided key. The key should be an attribute that exists within the data class; if it does not, an appropriate error should be raised. By default, the dataset should be ordered in ascending order; however, if the key is prefixed with a '-', the dataset should be ordered in descending order.