Rename query dfr -> query df (#6777)

This commit is contained in:
Dan Davison 2022-10-16 15:04:48 -04:00 committed by GitHub
parent 1a99893e2d
commit ce809881eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@ mod last;
mod list; mod list;
mod melt; mod melt;
mod open; mod open;
mod query_dfr; mod query_df;
mod rename; mod rename;
mod sample; mod sample;
mod shape; mod shape;
@ -45,7 +45,7 @@ pub use last::LastDF;
pub use list::ListDF; pub use list::ListDF;
pub use melt::MeltDF; pub use melt::MeltDF;
pub use open::OpenDataFrame; pub use open::OpenDataFrame;
pub use query_dfr::QueryDfr; pub use query_df::QueryDf;
pub use rename::RenameDF; pub use rename::RenameDF;
pub use sample::SampleDF; pub use sample::SampleDF;
pub use shape::ShapeDF; pub use shape::ShapeDF;
@ -87,7 +87,7 @@ pub fn add_eager_decls(working_set: &mut StateWorkingSet) {
ListDF, ListDF,
MeltDF, MeltDF,
OpenDataFrame, OpenDataFrame,
QueryDfr, QueryDf,
RenameDF, RenameDF,
SampleDF, SampleDF,
ShapeDF, ShapeDF,

View File

@ -14,11 +14,11 @@ use nu_protocol::{
// https://github.com/pola-rs/polars/tree/master/polars-sql // https://github.com/pola-rs/polars/tree/master/polars-sql
#[derive(Clone)] #[derive(Clone)]
pub struct QueryDfr; pub struct QueryDf;
impl Command for QueryDfr { impl Command for QueryDf {
fn name(&self) -> &str { fn name(&self) -> &str {
"query dfr" "query df"
} }
fn usage(&self) -> &str { fn usage(&self) -> &str {
@ -40,7 +40,7 @@ impl Command for QueryDfr {
fn examples(&self) -> Vec<Example> { fn examples(&self) -> Vec<Example> {
vec![Example { vec![Example {
description: "Query dataframe using SQL", description: "Query dataframe using SQL",
example: "[[a b]; [1 2] [3 4]] | into df | query dfr 'select a from df'", example: "[[a b]; [1 2] [3 4]] | into df | query df 'select a from df'",
result: Some( result: Some(
NuDataFrame::try_from_columns(vec![Column::new( NuDataFrame::try_from_columns(vec![Column::new(
"a".to_string(), "a".to_string(),
@ -101,6 +101,6 @@ mod test {
#[test] #[test]
fn test_examples() { fn test_examples() {
test_dataframe(vec![Box::new(QueryDfr {})]) test_dataframe(vec![Box::new(QueryDf {})])
} }
} }