#[cfg(feature = "duckdb")]
pub mod duckdb;
#[cfg(feature = "polars")]
pub mod polars;
use crate::error::TesseraError;
use crate::models::{IntoCoins, IntoMonths, PartitionRef};
#[cfg(any(feature = "polars", feature = "duckdb"))]
pub type ResolvedPartition = (PartitionRef, Vec<String>);
pub fn expand_refs(
asset: &str,
coin: impl IntoCoins,
month: impl IntoMonths,
) -> Result<Vec<PartitionRef>, TesseraError> {
let coins = coin.into_coins()?;
let months = month.into_months()?;
let mut refs = Vec::with_capacity(coins.len() * months.len());
for coin in &coins {
for month in &months {
refs.push(PartitionRef::new(asset, coin, month)?);
}
}
Ok(refs)
}