use polars_error::{polars_bail, PolarsResult};
use polars_plan::prelude::udf::UserDefinedFunction;
pub use polars_plan::prelude::{Context, FunctionOptions};
pub trait FunctionRegistry: Send + Sync {
    fn register(&mut self, name: &str, fun: UserDefinedFunction) -> PolarsResult<()>;
    fn get_udf(&self, name: &str) -> PolarsResult<Option<UserDefinedFunction>>;
    fn contains(&self, name: &str) -> bool;
}
pub struct DefaultFunctionRegistry {}
impl FunctionRegistry for DefaultFunctionRegistry {
    fn register(&mut self, _name: &str, _fun: UserDefinedFunction) -> PolarsResult<()> {
        polars_bail!(ComputeError: "'register' not implemented on DefaultFunctionRegistry'")
    }
    fn get_udf(&self, _name: &str) -> PolarsResult<Option<UserDefinedFunction>> {
        polars_bail!(ComputeError: "'get_udf' not implemented on DefaultFunctionRegistry'")
    }
    fn contains(&self, _name: &str) -> bool {
        false
    }
}