diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/mod.rs b/crates/nu_plugin_polars/src/dataframe/command/string/mod.rs index 990b519dc0..9cc0a399cd 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/mod.rs @@ -1,9 +1,9 @@ mod concat_str; mod contains; -mod replace; -mod replace_all; mod str_join; mod str_lengths; +mod str_replace; +mod str_replace_all; mod str_slice; mod str_split; mod str_strip_chars; @@ -15,10 +15,10 @@ use nu_plugin::PluginCommand; pub use concat_str::ExprConcatStr; pub use contains::Contains; -pub use replace::Replace; -pub use replace_all::ReplaceAll; pub use str_join::StrJoin; pub use str_lengths::StrLengths; +pub use str_replace::StrReplace; +pub use str_replace_all::StrReplaceAll; pub use str_slice::StrSlice; pub use to_lowercase::ToLowerCase; pub use to_uppercase::ToUpperCase; @@ -27,8 +27,8 @@ pub(crate) fn string_commands() -> Vec &str { - "polars replace" + "polars str-replace" } fn description(&self) -> &str { @@ -61,7 +61,7 @@ impl PluginCommand for Replace { Example { description: "Replaces string in column", example: - "[[a]; [abc] [abcabc]] | polars into-df | polars select (polars col a | polars replace --pattern ab --replace AB) | polars collect", + "[[a]; [abc] [abcabc]] | polars into-df | polars select (polars col a | polars str-replace --pattern ab --replace AB) | polars collect", result: Some( NuDataFrame::try_from_columns( vec![Column::new( @@ -80,7 +80,7 @@ impl PluginCommand for Replace { Example { description: "Replaces string", example: - "[abc abc abc] | polars into-df | polars replace --pattern ab --replace AB", + "[abc abc abc] | polars into-df | polars str-replace --pattern ab --replace AB", result: Some( NuDataFrame::try_from_columns( vec![Column::new( @@ -197,6 +197,6 @@ mod test { #[test] fn test_examples() -> Result<(), ShellError> { - test_polars_plugin_command(&Replace) + test_polars_plugin_command(&StrReplace) } } diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_replace_all.rs similarity index 95% rename from crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs rename to crates/nu_plugin_polars/src/dataframe/command/string/str_replace_all.rs index 25dfb24de2..97362127de 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/replace_all.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_replace_all.rs @@ -16,13 +16,13 @@ use nu_protocol::{ use polars::prelude::{lit, IntoSeries, StringNameSpaceImpl}; #[derive(Clone)] -pub struct ReplaceAll; +pub struct StrReplaceAll; -impl PluginCommand for ReplaceAll { +impl PluginCommand for StrReplaceAll { type Plugin = PolarsPlugin; fn name(&self) -> &str { - "polars replace-all" + "polars str-replace-all" } fn description(&self) -> &str { @@ -61,7 +61,7 @@ impl PluginCommand for ReplaceAll { Example { description: "Replaces string in a column", example: - "[[a]; [abac] [abac] [abac]] | polars into-df | polars select (polars col a | polars replace-all --pattern a --replace A) | polars collect", + "[[a]; [abac] [abac] [abac]] | polars into-df | polars select (polars col a | polars str-replace-all --pattern a --replace A) | polars collect", result: Some( NuDataFrame::try_from_columns( vec![Column::new( @@ -81,7 +81,7 @@ impl PluginCommand for ReplaceAll { Example { description: "Replaces string", example: - "[abac abac abac] | polars into-df | polars replace-all --pattern a --replace A", + "[abac abac abac] | polars into-df | polars str-replace-all --pattern a --replace A", result: Some( NuDataFrame::try_from_columns( vec![Column::new( @@ -198,6 +198,6 @@ mod test { #[test] fn test_examples() -> Result<(), ShellError> { - test_polars_plugin_command(&ReplaceAll) + test_polars_plugin_command(&StrReplaceAll) } }