1#[cfg(feature = "duckdb")]
4pub mod duckdb;
5#[cfg(feature = "polars")]
6pub mod polars;
7
8use crate::error::TesseraError;
9use crate::models::{IntoCoins, IntoMonths, PartitionRef};
10#[cfg(any(feature = "polars", feature = "duckdb"))]
11pub type ResolvedPartition = (PartitionRef, Vec<String>);
15
16pub fn expand_refs(
25 asset: &str,
26 coin: impl IntoCoins,
27 month: impl IntoMonths,
28) -> Result<Vec<PartitionRef>, TesseraError> {
29 let coins = coin.into_coins()?;
30 let months = month.into_months()?;
31 let mut refs = Vec::with_capacity(coins.len() * months.len());
32 for coin in &coins {
33 for month in &months {
34 refs.push(PartitionRef::new(asset, coin, month)?);
35 }
36 }
37 Ok(refs)
38}