forked from extern/nushell
No infer schema (#3683)
* Type in command description * filter name change * Clean column name * Clippy error and updated polars version * Lint correction in file * CSV Infer schema optional
This commit is contained in:
parent
596062ccab
commit
91da4e3168
@ -43,7 +43,7 @@ impl WholeStreamCommand for DataFrame {
|
||||
.named(
|
||||
"infer_schema",
|
||||
SyntaxShape::Number,
|
||||
"Set number of row to infer the schema of the file. CSV file",
|
||||
"Set number of rows to infer the schema of the file. CSV file",
|
||||
None,
|
||||
)
|
||||
.named(
|
||||
@ -172,14 +172,10 @@ fn from_csv(args: CommandArgs) -> Result<polars::prelude::DataFrame, ShellError>
|
||||
}
|
||||
};
|
||||
|
||||
let csv_reader = if no_header {
|
||||
csv_reader.has_header(false)
|
||||
} else {
|
||||
csv_reader.has_header(true)
|
||||
};
|
||||
let csv_reader = csv_reader.has_header(!no_header);
|
||||
|
||||
let csv_reader = match infer_schema {
|
||||
None => csv_reader.infer_schema(None),
|
||||
None => csv_reader,
|
||||
Some(r) => csv_reader.infer_schema(Some(r.item)),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user