mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 22:41:52 +02:00
fix compilation errors
This commit is contained in:
2
crates/nu_plugin_polars/src/cache/rm.rs
vendored
2
crates/nu_plugin_polars/src/cache/rm.rs
vendored
@ -89,7 +89,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_remove() -> Result<(), ShellError> {
|
||||
let plugin = PolarsPlugin::new_test_mode().into();
|
||||
let plugin = PolarsPlugin::new_test_mode()?.into();
|
||||
let pipeline_data = PluginTest::new("polars", plugin)?
|
||||
.add_decl(Box::new(First))?
|
||||
.add_decl(Box::new(Get))?
|
||||
|
@ -63,5 +63,5 @@ async fn build_aws_cloud_configs() -> Result<Vec<(AmazonS3ConfigKey, String)>, S
|
||||
|
||||
pub(crate) fn build_cloud_options(plugin: &PolarsPlugin) -> Result<CloudOptions, ShellError> {
|
||||
let configs = plugin.runtime.block_on(build_aws_cloud_configs())?;
|
||||
Ok(CloudOptions::default().with_aws(configs.into_iter()))
|
||||
Ok(CloudOptions::default().with_aws(configs))
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ pub(crate) mod test {
|
||||
let tmp_file_str = tmp_file.to_str().expect("should be able to get file path");
|
||||
|
||||
let cmd = format!("{cmd} {tmp_file_str}");
|
||||
let mut plugin_test = PluginTest::new("polars", PolarsPlugin::default().into())?;
|
||||
let mut plugin_test = PluginTest::new("polars", PolarsPlugin::new()?.into())?;
|
||||
plugin_test.engine_state_mut().add_env_var(
|
||||
"PWD".to_string(),
|
||||
Value::string(
|
||||
|
@ -79,7 +79,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_to_lazy() -> Result<(), ShellError> {
|
||||
let plugin: Arc<PolarsPlugin> = PolarsPlugin::new_test_mode().into();
|
||||
let plugin: Arc<PolarsPlugin> = PolarsPlugin::new_test_mode()?.into();
|
||||
let mut plugin_test = PluginTest::new("polars", Arc::clone(&plugin))?;
|
||||
let pipeline_data = plugin_test.eval("[[a b]; [6 2] [1 4] [4 1]] | polars into-lazy")?;
|
||||
let value = pipeline_data.into_value(Span::test_data())?;
|
||||
|
@ -255,11 +255,11 @@ pub mod test {
|
||||
|
||||
impl PolarsPlugin {
|
||||
/// Creates a new polars plugin in test mode
|
||||
pub fn new_test_mode() -> Self {
|
||||
PolarsPlugin {
|
||||
pub fn new_test_mode() -> Result<Self, ShellError> {
|
||||
Ok(PolarsPlugin {
|
||||
disable_cache_drop: true,
|
||||
..PolarsPlugin::default()
|
||||
}
|
||||
..PolarsPlugin::new()?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ pub mod test {
|
||||
command: &impl PluginCommand,
|
||||
decls: Vec<Box<dyn Command>>,
|
||||
) -> Result<(), ShellError> {
|
||||
let plugin = PolarsPlugin::new_test_mode();
|
||||
let plugin = PolarsPlugin::new_test_mode()?;
|
||||
let examples = command.examples();
|
||||
|
||||
// we need to cache values in the examples
|
||||
|
Reference in New Issue
Block a user