mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 15:08:13 +02:00
Move input/output type from Command to Signature (#5880)
This commit is contained in:
@ -23,6 +23,8 @@ impl Command for AppendDF {
|
||||
Signature::build(self.name())
|
||||
.required("other", SyntaxShape::Any, "dataframe to be appended")
|
||||
.switch("col", "appends in col orientation", Some('c'))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -87,14 +89,6 @@ impl Command for AppendDF {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,6 +29,8 @@ impl Command for DescribeDF {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.named(
|
||||
"quantiles",
|
||||
SyntaxShape::Table,
|
||||
@ -95,14 +97,6 @@ impl Command for DescribeDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -23,6 +23,8 @@ impl Command for DropDF {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.rest("rest", SyntaxShape::Any, "column names to be dropped")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -41,14 +43,6 @@ impl Command for DropDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -34,6 +34,8 @@ impl Command for DropDuplicates {
|
||||
"keeps last duplicate value (by default keeps first)",
|
||||
Some('l'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -58,14 +60,6 @@ impl Command for DropDuplicates {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -27,6 +27,8 @@ impl Command for DropNulls {
|
||||
SyntaxShape::Table,
|
||||
"subset of columns to drop nulls",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -78,14 +80,6 @@ impl Command for DropNulls {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -18,7 +18,10 @@ impl Command for DataTypes {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -42,14 +45,6 @@ impl Command for DataTypes {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for Dummies {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -93,14 +96,6 @@ impl Command for Dummies {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,6 +29,8 @@ impl Command for FilterWith {
|
||||
SyntaxShape::Any,
|
||||
"boolean mask used to filter data",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe or lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -62,14 +64,6 @@ impl Command for FilterWith {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -21,6 +21,8 @@ impl Command for FirstDF {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.optional("rows", SyntaxShape::Int, "Number of rows for head")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -39,14 +41,6 @@ impl Command for FirstDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -24,6 +24,8 @@ impl Command for GetDF {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.rest("rest", SyntaxShape::Any, "column names to sort dataframe")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -42,14 +44,6 @@ impl Command for GetDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -21,6 +21,8 @@ impl Command for LastDF {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.optional("rows", SyntaxShape::Int, "Number of rows for tail")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -39,14 +41,6 @@ impl Command for LastDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -48,6 +48,8 @@ impl Command for MeltDF {
|
||||
"optional name for value column",
|
||||
Some('l'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -109,14 +111,6 @@ impl Command for MeltDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -58,6 +58,8 @@ impl Command for OpenDataFrame {
|
||||
"Columns to be selected from csv file. CSV and Parquet file",
|
||||
None,
|
||||
)
|
||||
.input_type(Type::Any)
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -69,14 +71,6 @@ impl Command for OpenDataFrame {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -33,6 +33,8 @@ impl Command for RenameDF {
|
||||
SyntaxShape::Any,
|
||||
"New names for the selected column(s). A string or list of strings",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe or lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -94,14 +96,6 @@ impl Command for RenameDF {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -41,6 +41,8 @@ impl Command for SampleDF {
|
||||
)
|
||||
.switch("replace", "sample with replace", Some('e'))
|
||||
.switch("shuffle", "shuffle sample", Some('u'))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -59,14 +61,6 @@ impl Command for SampleDF {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -21,7 +21,10 @@ impl Command for ShapeDF {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -39,14 +42,6 @@ impl Command for ShapeDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -25,6 +25,8 @@ impl Command for SliceDF {
|
||||
Signature::build(self.name())
|
||||
.required("offset", SyntaxShape::Int, "start of slice")
|
||||
.required("size", SyntaxShape::Int, "size of slice")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -43,14 +45,6 @@ impl Command for SliceDF {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,6 +29,8 @@ impl Command for TakeDF {
|
||||
SyntaxShape::Any,
|
||||
"list of indices used to take data",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -71,14 +73,6 @@ impl Command for TakeDF {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -32,6 +32,8 @@ impl Command for ToCSV {
|
||||
Some('d'),
|
||||
)
|
||||
.switch("no-header", "Indicates if file doesn't have header", None)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Any)
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -50,14 +52,6 @@ impl Command for ToCSV {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for ToDataFrame {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Any)
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -103,14 +106,6 @@ impl Command for ToDataFrame {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -28,6 +28,8 @@ impl Command for ToNu {
|
||||
Some('n'),
|
||||
)
|
||||
.switch("tail", "shows tail rows", Some('t'))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Any)
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -64,14 +66,6 @@ impl Command for ToNu {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -25,6 +25,8 @@ impl Command for ToParquet {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.required("file", SyntaxShape::Filepath, "file path to save dataframe")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Any)
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -36,14 +38,6 @@ impl Command for ToParquet {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -27,6 +27,8 @@ impl Command for WithColumn {
|
||||
SyntaxShape::Any,
|
||||
"series to be added or expressions used to define the new columns",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe or lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -91,14 +93,6 @@ impl Command for WithColumn {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for ExprAlias {
|
||||
SyntaxShape::String,
|
||||
"Alias name for the expression",
|
||||
)
|
||||
.input_type(Type::Custom("expression".into()))
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
@ -57,14 +59,6 @@ impl Command for ExprAlias {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for ExprAsNu {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("expression".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("expression".into()))
|
||||
.output_type(Type::Any)
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -43,14 +46,6 @@ impl Command for ExprAsNu {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for ExprCol {
|
||||
SyntaxShape::String,
|
||||
"Name of column to be used",
|
||||
)
|
||||
.input_type(Type::Any)
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
@ -50,14 +52,6 @@ impl Command for ExprCol {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -25,21 +25,16 @@ macro_rules! expr_command {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("expression".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("expression".into()))
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
$examples
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -25,6 +25,8 @@ impl Command for ExprLit {
|
||||
SyntaxShape::Any,
|
||||
"literal to construct the expression",
|
||||
)
|
||||
.input_type(Type::Any)
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
@ -49,14 +51,6 @@ impl Command for ExprLit {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -25,6 +25,8 @@ impl Command for ExprOtherwise {
|
||||
SyntaxShape::Any,
|
||||
"expressioini to apply when no when predicate matches",
|
||||
)
|
||||
.input_type(Type::Any)
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
@ -77,14 +79,6 @@ impl Command for ExprOtherwise {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for ExprQuantile {
|
||||
SyntaxShape::Number,
|
||||
"quantile value for quantile operation",
|
||||
)
|
||||
.input_type(Type::Custom("expression".into()))
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
@ -53,14 +55,6 @@ impl Command for ExprQuantile {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -31,6 +31,8 @@ impl Command for ExprWhen {
|
||||
SyntaxShape::Any,
|
||||
"expression that will be applied when predicate is true",
|
||||
)
|
||||
.input_type(Type::Custom("expression".into()))
|
||||
.output_type(Type::Custom("expression".into()))
|
||||
.category(Category::Custom("expression".into()))
|
||||
}
|
||||
|
||||
@ -83,14 +85,6 @@ impl Command for ExprWhen {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("expression".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for LazyAggregate {
|
||||
SyntaxShape::Any,
|
||||
"Expression(s) that define the aggregations to be applied",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -101,14 +103,6 @@ impl Command for LazyAggregate {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for LazyCollect {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("lazyframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -44,14 +47,6 @@ impl Command for LazyCollect {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for LazyFetch {
|
||||
SyntaxShape::Int,
|
||||
"number of rows to be fetched from lazyframe",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -50,14 +52,6 @@ impl Command for LazyFetch {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -25,6 +25,8 @@ impl Command for LazyFillNA {
|
||||
SyntaxShape::Any,
|
||||
"Expression to use to fill the NAN values",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -36,14 +38,6 @@ impl Command for LazyFillNA {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -25,6 +25,8 @@ impl Command for LazyFillNull {
|
||||
SyntaxShape::Any,
|
||||
"Expression to use to fill the null values",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -49,14 +51,6 @@ impl Command for LazyFillNull {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for ToLazyGroupBy {
|
||||
SyntaxShape::Any,
|
||||
"Expression(s) that define the lazy group by",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -101,14 +103,6 @@ impl Command for ToLazyGroupBy {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -38,6 +38,8 @@ impl Command for LazyJoin {
|
||||
"Suffix to use on columns with same name",
|
||||
Some('s'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -160,14 +162,6 @@ impl Command for LazyJoin {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -23,21 +23,16 @@ macro_rules! lazy_command {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("lazyframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
$examples
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -26,6 +26,8 @@ impl Command for LazyQuantile {
|
||||
SyntaxShape::Number,
|
||||
"quantile value for quantile operation",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -44,14 +46,6 @@ impl Command for LazyQuantile {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -27,6 +27,8 @@ impl Command for LazySelect {
|
||||
SyntaxShape::Any,
|
||||
"Expression(s) that define the column selection",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -45,14 +47,6 @@ impl Command for LazySelect {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -32,6 +32,8 @@ impl Command for LazySortBy {
|
||||
"Reverse sorting. Default is false",
|
||||
Some('r'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -87,14 +89,6 @@ impl Command for LazySortBy {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for ToLazyFrame {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("lazyframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Any)
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("lazyframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -30,14 +33,6 @@ impl Command for ToLazyFrame {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Any
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
_engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for AllFalse {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -53,14 +56,6 @@ impl Command for AllFalse {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for AllTrue {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -53,14 +56,6 @@ impl Command for AllTrue {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for ArgMax {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -38,14 +41,6 @@ impl Command for ArgMax {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for ArgMin {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -38,14 +41,6 @@ impl Command for ArgMin {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -56,6 +56,8 @@ impl Command for Cumulative {
|
||||
Signature::build(self.name())
|
||||
.required("type", SyntaxShape::String, "rolling operation")
|
||||
.switch("reverse", "Reverse cumulative calculation", Some('r'))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -80,14 +82,6 @@ impl Command for Cumulative {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -31,7 +31,9 @@ impl Command for AsDate {
|
||||
Signature::build(self.name())
|
||||
.required("format", SyntaxShape::String, "formatting date string")
|
||||
.switch("not-exact", "the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01)", Some('n'))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -42,14 +44,6 @@ impl Command for AsDate {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -40,7 +40,9 @@ impl Command for AsDateTime {
|
||||
Signature::build(self.name())
|
||||
.required("format", SyntaxShape::String, "formatting date time string")
|
||||
.switch("not-exact", "the format string may be contained in the date (e.g. foo-2021-01-01-bar could match 2021-01-01)", Some('n'))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -75,14 +77,6 @@ impl Command for AsDateTime {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetDay {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetDay {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetHour {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetHour {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetMinute {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetMinute {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetMonth {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetMonth {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetNanosecond {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetNanosecond {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetOrdinal {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetOrdinal {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetSecond {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetSecond {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetWeek {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetWeek {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetWeekDay {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetWeekDay {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for GetYear {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -40,14 +43,6 @@ impl Command for GetYear {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -23,6 +23,8 @@ impl Command for ArgSort {
|
||||
Signature::build(self.name())
|
||||
.switch("reverse", "reverse order", Some('r'))
|
||||
.switch("nulls-last", "nulls ordered last", Some('n'))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -67,14 +69,6 @@ impl Command for ArgSort {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for ArgTrue {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -38,14 +41,6 @@ impl Command for ArgTrue {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for ArgUnique {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -38,14 +41,6 @@ impl Command for ArgUnique {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,6 +29,8 @@ impl Command for SetWithIndex {
|
||||
"list of indices indicating where to set the value",
|
||||
Some('i'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -56,14 +58,6 @@ impl Command for SetWithIndex {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for IsDuplicated {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -46,14 +49,6 @@ impl Command for IsDuplicated {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -23,6 +23,8 @@ impl Command for IsIn {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.required("other", SyntaxShape::Any, "right series")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -50,14 +52,6 @@ impl Command for IsIn {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for IsNotNull {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -44,14 +47,6 @@ impl Command for IsNotNull {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for IsNull {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -44,14 +47,6 @@ impl Command for IsNull {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for IsUnique {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -46,14 +49,6 @@ impl Command for IsUnique {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -21,7 +21,10 @@ impl Command for NotSeries {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -43,14 +46,6 @@ impl Command for NotSeries {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,6 +29,8 @@ impl Command for SetSeries {
|
||||
"mask indicating insertions",
|
||||
Some('m'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -55,14 +57,6 @@ impl Command for SetSeries {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for NNull {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -38,14 +41,6 @@ impl Command for NNull {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -18,7 +18,10 @@ impl Command for NUnique {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -36,14 +39,6 @@ impl Command for NUnique {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -59,6 +59,8 @@ impl Command for Rolling {
|
||||
Signature::build(self.name())
|
||||
.required("type", SyntaxShape::String, "rolling operation")
|
||||
.required("window", SyntaxShape::Int, "Window size for rolling")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -101,14 +103,6 @@ impl Command for Rolling {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -30,6 +30,8 @@ impl Command for Shift {
|
||||
"Expression used to fill the null values (lazy df)",
|
||||
Some('f'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe or lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -48,14 +50,6 @@ impl Command for Shift {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -27,6 +27,8 @@ impl Command for Concatenate {
|
||||
SyntaxShape::Any,
|
||||
"Other array with string to be concatenated",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -50,14 +52,6 @@ impl Command for Concatenate {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -27,6 +27,8 @@ impl Command for Contains {
|
||||
SyntaxShape::String,
|
||||
"Regex pattern to be searched",
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -49,14 +51,6 @@ impl Command for Contains {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -34,6 +34,8 @@ impl Command for Replace {
|
||||
"replacing string",
|
||||
Some('r'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -56,14 +58,6 @@ impl Command for Replace {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -34,6 +34,8 @@ impl Command for ReplaceAll {
|
||||
"replacing string",
|
||||
Some('r'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -56,14 +58,6 @@ impl Command for ReplaceAll {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for StrLengths {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -38,14 +41,6 @@ impl Command for StrLengths {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -24,6 +24,8 @@ impl Command for StrSlice {
|
||||
Signature::build(self.name())
|
||||
.required("start", SyntaxShape::Int, "start of slice")
|
||||
.named("length", SyntaxShape::Int, "optional length", Some('l'))
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -46,14 +48,6 @@ impl Command for StrSlice {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -23,6 +23,8 @@ impl Command for StrFTime {
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name())
|
||||
.required("fmt", SyntaxShape::String, "Format rule")
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
@ -46,14 +48,6 @@ impl Command for StrFTime {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for ToLowerCase {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -42,14 +45,6 @@ impl Command for ToLowerCase {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -20,7 +20,10 @@ impl Command for ToUpperCase {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -42,14 +45,6 @@ impl Command for ToUpperCase {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -40,6 +40,8 @@ impl Command for Unique {
|
||||
"Keep the same order as the original DataFrame (lazy df)",
|
||||
Some('k'),
|
||||
)
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe or lazyframe".into()))
|
||||
}
|
||||
|
||||
@ -65,14 +67,6 @@ impl Command for Unique {
|
||||
]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,7 +19,10 @@ impl Command for ValueCount {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build(self.name()).category(Category::Custom("dataframe".into()))
|
||||
Signature::build(self.name())
|
||||
.input_type(Type::Custom("dataframe".into()))
|
||||
.output_type(Type::Custom("dataframe".into()))
|
||||
.category(Category::Custom("dataframe".into()))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
@ -43,14 +46,6 @@ impl Command for ValueCount {
|
||||
}]
|
||||
}
|
||||
|
||||
fn input_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn output_type(&self) -> Type {
|
||||
Type::Custom("dataframe".into())
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
Reference in New Issue
Block a user