% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sorting_utils.R
\name{validate_sort_column}
\alias{validate_sort_column}
\title{Validate that a column-based sort references an existing column}
\usage{
validate_sort_column(
  sort_by,
  data,
  allowed = .saros.env$allowed_dep_sort_columns,
  call = rlang::caller_env()
)
}
\arguments{
\item{sort_by}{Character scalar, or \code{NULL}. The column name to sort by.
Non-scalar values are silently accepted (no column validation).}

\item{data}{Data frame to check.}

\item{allowed}{Character vector of whitelisted column names.}

\item{call}{Calling environment for error reporting.}
}
\value{
\code{TRUE} invisibly if valid.
}
\description{
Fails fast with an informative error when \code{sort_by} names a column
(from the allowed whitelist) that is not present in \code{data}.
Only performs validation for scalar \code{sort_by}; non-scalar values
(e.g. category vectors) are skipped since they are validated by
\code{\link[=validate_sort_category]{validate_sort_category()}} instead.
}
\keyword{internal}
