Move input/output type from Command to Signature (#5880)

This commit is contained in:
JT 2022-06-26 09:23:56 +12:00 committed by GitHub
parent 575ddbd4ef
commit f2989bf704
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
117 changed files with 344 additions and 981 deletions

View file

@ -19,6 +19,8 @@ impl Command for AliasDb {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("alias", SyntaxShape::String, "alias name")
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -82,14 +84,6 @@ impl Command for AliasDb {
]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "alias", "column"]
}

View file

@ -25,6 +25,8 @@ impl Command for AndDb {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("where", SyntaxShape::Any, "Where expression on the table")
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -32,14 +34,6 @@ impl Command for AndDb {
vec!["database", "where"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View file

@ -15,21 +15,16 @@ impl Command for CollectDb {
}
fn signature(&self) -> Signature {
Signature::build(self.name()).category(Category::Custom("database".into()))
Signature::build(self.name())
.input_type(Type::Custom("database".into()))
.output_type(Type::Any)
.category(Category::Custom("database".into()))
}
fn usage(&self) -> &str {
"Collects a query from a database database connection"
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Any
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Collect from a select query",

View file

@ -15,21 +15,16 @@ impl Command for DescribeDb {
}
fn signature(&self) -> Signature {
Signature::build(self.name()).category(Category::Custom("database".into()))
Signature::build(self.name())
.input_type(Type::Custom("database".into()))
.output_type(Type::Any)
.category(Category::Custom("database".into()))
}
fn usage(&self) -> &str {
"Describes connection and query of the DB object"
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Any
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Describe SQLite database constructed query",

View file

@ -35,6 +35,8 @@ impl Command for FromDb {
"Alias for the selected table",
Some('a'),
)
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -42,14 +44,6 @@ impl Command for FromDb {
vec!["database", "from"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Selects a table from database",

View file

@ -29,6 +29,8 @@ impl Command for GroupByDb {
SyntaxShape::Any,
"Select expression(s) on the table",
)
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -36,14 +38,6 @@ impl Command for GroupByDb {
vec!["database", "select"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View file

@ -41,6 +41,8 @@ impl Command for JoinDb {
.switch("right", "right outer join", Some('r'))
.switch("outer", "full outer join", Some('o'))
.switch("cross", "cross join", Some('c'))
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -48,14 +50,6 @@ impl Command for JoinDb {
vec!["database", "join"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View file

@ -28,6 +28,8 @@ impl Command for LimitDb {
SyntaxShape::Int,
"Number of rows to extract for query",
)
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -61,14 +63,6 @@ impl Command for LimitDb {
}]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn run(
&self,
engine_state: &EngineState,

View file

@ -19,6 +19,8 @@ impl Command for OpenDb {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("query", SyntaxShape::Filepath, "SQLite file to be opened")
.input_type(Type::Any)
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -38,14 +40,6 @@ impl Command for OpenDb {
}]
}
fn input_type(&self) -> Type {
Type::Any
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn run(
&self,
engine_state: &EngineState,

View file

@ -25,6 +25,8 @@ impl Command for OrDb {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("where", SyntaxShape::Any, "Where expression on the table")
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -32,14 +34,6 @@ impl Command for OrDb {
vec!["database", "where"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View file

@ -31,6 +31,8 @@ impl Command for OrderByDb {
SyntaxShape::Any,
"Select expression(s) on the table",
)
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -38,14 +40,6 @@ impl Command for OrderByDb {
vec!["database", "order-by"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View file

@ -23,6 +23,8 @@ impl Command for QueryDb {
SyntaxShape::String,
"SQL to execute against the database",
)
.input_type(Type::Custom("database".into()))
.output_type(Type::Any)
.category(Category::Custom("database".into()))
}
@ -30,14 +32,6 @@ impl Command for QueryDb {
"Query a database using SQL."
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Any
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Execute a query statement using the database connection",

View file

@ -15,21 +15,16 @@ impl Command for SchemaDb {
}
fn signature(&self) -> Signature {
Signature::build(self.name()).category(Category::Custom("database".into()))
Signature::build(self.name())
.input_type(Type::Custom("database".into()))
.output_type(Type::Any)
.category(Category::Custom("database".into()))
}
fn usage(&self) -> &str {
"Show sqlite database information, including its schema."
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Any
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Show the schema of a SQLite database",

View file

@ -27,6 +27,8 @@ impl Command for ProjectionDb {
SyntaxShape::Any,
"Select expression(s) on the table",
)
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -34,14 +36,6 @@ impl Command for ProjectionDb {
vec!["database", "select"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![
Example {

View file

@ -19,7 +19,10 @@ impl Command for ToDataBase {
}
fn signature(&self) -> Signature {
Signature::build(self.name()).category(Category::Custom("database".into()))
Signature::build(self.name())
.input_type(Type::Any)
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
fn search_terms(&self) -> Vec<&str> {
@ -34,14 +37,6 @@ impl Command for ToDataBase {
}]
}
fn input_type(&self) -> Type {
Type::Any
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn run(
&self,
_engine_state: &EngineState,

View file

@ -25,6 +25,8 @@ impl Command for WhereDb {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("where", SyntaxShape::Any, "Where expression on the table")
.input_type(Type::Custom("database".into()))
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -32,14 +34,6 @@ impl Command for WhereDb {
vec!["database", "where"]
}
fn input_type(&self) -> Type {
Type::Custom("database".into())
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "selects a column from a database with a where clause",

View file

@ -19,6 +19,8 @@ impl Command for AliasExpr {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("alias", SyntaxShape::String, "alias name")
.input_type(Type::Custom("db-expression".into()))
.output_type(Type::Custom("db-expression".into()))
.category(Category::Custom("db-expression".into()))
}
@ -67,14 +69,6 @@ impl Command for AliasExpr {
}]
}
fn input_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn output_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "alias", "column"]
}

View file

@ -24,6 +24,8 @@ impl Command for AndExpr {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("and", SyntaxShape::Any, "AND expression")
.input_type(Type::Custom("db-expression".into()))
.output_type(Type::Custom("db-expression".into()))
.category(Category::Custom("db-expression".into()))
}
@ -31,14 +33,6 @@ impl Command for AndExpr {
vec!["database", "and", "expression"]
}
fn input_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn output_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Creates an AND expression",

View file

@ -19,7 +19,10 @@ impl Command for ExprAsNu {
}
fn signature(&self) -> Signature {
Signature::build(self.name()).category(Category::Custom("db-expression".into()))
Signature::build(self.name())
.input_type(Type::Custom("db-expression".into()))
.output_type(Type::Any)
.category(Category::Custom("db-expression".into()))
}
fn examples(&self) -> Vec<Example> {
@ -43,14 +46,6 @@ impl Command for ExprAsNu {
}]
}
fn input_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn output_type(&self) -> Type {
Type::Any
}
fn run(
&self,
_engine_state: &EngineState,

View file

@ -18,6 +18,8 @@ impl Command for FieldExpr {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("name", SyntaxShape::String, "column name")
.input_type(Type::Any)
.output_type(Type::Custom("db-expression".into()))
.category(Category::Custom("db-expression".into()))
}
@ -50,14 +52,6 @@ impl Command for FieldExpr {
}]
}
fn input_type(&self) -> Type {
Type::Any
}
fn output_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn run(
&self,
engine_state: &EngineState,

View file

@ -21,6 +21,8 @@ impl Command for FunctionExpr {
.required("name", SyntaxShape::String, "function name")
.switch("distinct", "distict values", Some('d'))
.rest("arguments", SyntaxShape::Any, "function arguments")
.input_type(Type::Any)
.output_type(Type::Custom("db-expression".into()))
.category(Category::Custom("db-expression".into()))
}
@ -89,14 +91,6 @@ impl Command for FunctionExpr {
]
}
fn input_type(&self) -> Type {
Type::Any
}
fn output_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "function", "expression"]
}

View file

@ -24,6 +24,8 @@ impl Command for OrExpr {
fn signature(&self) -> Signature {
Signature::build(self.name())
.required("or", SyntaxShape::Any, "OR expression")
.input_type(Type::Custom("db-expression".into()))
.output_type(Type::Custom("db-expression".into()))
.category(Category::Custom("db-expression".into()))
}
@ -31,14 +33,6 @@ impl Command for OrExpr {
vec!["database", "or", "expression"]
}
fn input_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn output_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Creates an AND expression",

View file

@ -23,6 +23,8 @@ impl Command for OverExpr {
SyntaxShape::Any,
"columns to partition the window function",
)
.input_type(Type::Custom("db-expression".into()))
.output_type(Type::Custom("db-expression".into()))
.category(Category::Custom("db-expression".into()))
}
@ -90,14 +92,6 @@ impl Command for OverExpr {
]
}
fn input_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn output_type(&self) -> Type {
Type::Custom("db-expression".into())
}
fn search_terms(&self) -> Vec<&str> {
vec!["database", "over", "expression"]
}

View file

@ -29,6 +29,8 @@ impl Command for CustomOpen {
nu_protocol::SyntaxShape::String,
"the filename to use",
)
.input_type(Type::Any)
.output_type(Type::Custom("database".into()))
.category(Category::Custom("database".into()))
}
@ -45,14 +47,6 @@ impl Command for CustomOpen {
let db = SQLiteDatabase::new(path);
Ok(db.into_value(call.head).into_pipeline_data())
}
fn input_type(&self) -> Type {
Type::Any
}
fn output_type(&self) -> Type {
Type::Custom("database".into())
}
}
pub fn test_database(cmds: Vec<Box<dyn Command + 'static>>) {

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -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,

Some files were not shown because too many files have changed in this diff Show more