use thiserror::Error;
#[derive(Debug, Error, Clone)]
pub enum PolarsError {
#[error("Schema validation error: {0}")]
SchemaValidationError(String),
#[error("Column type error: {0}")]
ColumnTypeError(String),
#[error("Missing column error: {0}")]
MissingColumnError(String),
#[error("Data conversion error: {0}")]
DataConversionError(String),
#[error(
"Observer fields are partially null at row {row}: obs_lon={obs_lon}, obs_lat={obs_lat}, obs_alt={obs_alt} — the triplet must be all non-null or all null"
)]
PartialTripletNull {
row: usize,
obs_lon: bool,
obs_lat: bool,
obs_alt: bool,
},
#[error(
"obs_ra_acc / obs_dec_acc are required when the geodetic triplet is fully specified (row {0})"
)]
MissingAccuracyForGeodesic(usize),
#[error("Invalid MPC code '{0}' at row {1}: must be exactly 3 ASCII bytes")]
InvalidMpcCode(String, usize),
#[error("filter column has unsupported type: {0} (expected String or UInt32)")]
FilterColumnTypeError(String),
#[error("night_id column has unsupported type: {0} (expected UInt32)")]
NightIdColumnTypeError(String),
#[error("traj_id column has unsupported type: {0} (expected UInt32 or String)")]
TrajIdColumnTypeError(String),
#[error(transparent)]
Polars(#[from] polars::error::PolarsError),
#[error("Expected exactly 7 Float64 columns in base_fields(), but got a different number")]
Float64ColumnCountError,
}