def sorted_columns_from_features(features):
  """Sort feature columns by name to ensure the order is consistent."""
  feature_columns = []
  for feature in features:
    feature_columns.extend(feature.columns)
  return sorted(feature_columns, key=lambda column: column.name)