diff --git a/crates/polars-ops/src/frame/join/mod.rs b/crates/polars-ops/src/frame/join/mod.rs index 17d3f59b833f..74da0a32b68a 100644 --- a/crates/polars-ops/src/frame/join/mod.rs +++ b/crates/polars-ops/src/frame/join/mod.rs @@ -52,12 +52,13 @@ pub trait DataFrameJoinOps: IntoDf { /// /// ```no_run /// # use polars_core::prelude::*; + /// # use polars_ops::prelude::*; /// let df1: DataFrame = df!("Fruit" => &["Apple", "Banana", "Pear"], /// "Phosphorus (mg/100g)" => &[11, 22, 12])?; /// let df2: DataFrame = df!("Name" => &["Apple", "Banana", "Pear"], /// "Potassium (mg/100g)" => &[107, 358, 115])?; /// - /// let df3: DataFrame = df1.join(&df2, ["Fruit"], ["Name"], JoinType::Inner, None)?; + /// let df3: DataFrame = df1.join(&df2, ["Fruit"], ["Name"], JoinArgs::new(JoinType::Inner))?; /// assert_eq!(df3.shape(), (3, 3)); /// println!("{}", df3); /// # Ok::<(), PolarsError>(()) @@ -369,6 +370,7 @@ pub trait DataFrameJoinOps: IntoDf { /// /// ``` /// # use polars_core::prelude::*; + /// # use polars_ops::prelude::*; /// fn join_dfs(left: &DataFrame, right: &DataFrame) -> PolarsResult { /// left.inner_join(right, ["join_column_left"], ["join_column_right"]) /// } @@ -391,6 +393,7 @@ pub trait DataFrameJoinOps: IntoDf { /// /// ```no_run /// # use polars_core::prelude::*; + /// # use polars_ops::prelude::*; /// let df1: DataFrame = df!("Wavelength (nm)" => &[480.0, 650.0, 577.0, 1201.0, 100.0])?; /// let df2: DataFrame = df!("Color" => &["Blue", "Yellow", "Red"], /// "Wavelength nm" => &[480.0, 577.0, 650.0])?; @@ -433,6 +436,7 @@ pub trait DataFrameJoinOps: IntoDf { /// /// ``` /// # use polars_core::prelude::*; + /// # use polars_ops::prelude::*; /// fn join_dfs(left: &DataFrame, right: &DataFrame) -> PolarsResult { /// left.outer_join(right, ["join_column_left"], ["join_column_right"]) /// } diff --git a/crates/polars-ops/src/series/ops/approx_algo/hyperloglogplus.rs b/crates/polars-ops/src/series/ops/approx_algo/hyperloglogplus.rs index 7df61317d9bc..d507a1fcf20c 100644 --- a/crates/polars-ops/src/series/ops/approx_algo/hyperloglogplus.rs +++ b/crates/polars-ops/src/series/ops/approx_algo/hyperloglogplus.rs @@ -9,6 +9,7 @@ //! # Examples //! //! ``` +//! # use polars_ops::prelude::*; //! let mut hllp = HyperLogLog::new(); //! hllp.add(&12345); //! hllp.add(&23456); diff --git a/crates/polars-plan/src/dsl/functions/temporal.rs b/crates/polars-plan/src/dsl/functions/temporal.rs index 6ae7a8ee0c5c..b2eb3af5a229 100644 --- a/crates/polars-plan/src/dsl/functions/temporal.rs +++ b/crates/polars-plan/src/dsl/functions/temporal.rs @@ -156,6 +156,7 @@ pub fn datetime(args: DatetimeArgs) -> Expr { /// their default value of `lit(0)`, as demonstrated below. /// /// ``` +/// # use polars_plan::prelude::*; /// let args = DurationArgs { /// days: lit(5), /// hours: col("num_hours"), @@ -165,6 +166,7 @@ pub fn datetime(args: DatetimeArgs) -> Expr { /// ``` /// If you prefer builder syntax, `with_*` methods are also available. /// ``` +/// # use polars_plan::prelude::*; /// let args = DurationArgs::new().with_weeks(lit(42)).with_hours(lit(84)); /// ``` #[derive(Debug, Clone)] diff --git a/crates/polars-plan/src/dsl/mod.rs b/crates/polars-plan/src/dsl/mod.rs index 40dbb939de6f..05dca3120e10 100644 --- a/crates/polars-plan/src/dsl/mod.rs +++ b/crates/polars-plan/src/dsl/mod.rs @@ -1141,6 +1141,7 @@ impl Expr { /// Keep the original root name /// /// ```rust,no_run + /// # use polars_core::prelude::*; /// # use polars_plan::prelude::*; /// fn example(df: LazyFrame) -> LazyFrame { /// df.select([ @@ -1181,21 +1182,6 @@ impl Expr { /// Exclude a column from a wildcard/regex selection. /// /// You may also use regexes in the exclude as long as they start with `^` and end with `$`/ - /// - /// # Example - /// - /// ```rust - /// use polars_core::prelude::*; - /// use polars_lazy::prelude::*; - /// - /// // Select all columns except foo. - /// fn example(df: DataFrame) -> LazyFrame { - /// df.lazy() - /// .select(&[ - /// col("*").exclude(&["foo"]) - /// ]) - /// } - /// ``` pub fn exclude(self, columns: impl IntoVec) -> Expr { let v = columns .into_vec()