Skip to content

Commit

Permalink
fix[python]: assign appropriate timeunit to Series generated by `da…
Browse files Browse the repository at this point in the history
…te_range` (#4592)
  • Loading branch information
alexander-beedie committed Aug 28, 2022
1 parent b79dc8d commit a8d131c
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 79 deletions.
2 changes: 1 addition & 1 deletion polars/polars-lazy/src/dsl/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl ListNameSpace {
move |s| Ok(s.list()?.lst_shift(periods).into_series()),
GetOutput::same_type(),
)
.with_fmt("arr.diff")
.with_fmt("arr.shift")
}

/// Slice every sublist.
Expand Down
10 changes: 5 additions & 5 deletions polars/polars-lazy/src/dsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ impl Expr {
move |s| s.sample_frac(frac, with_replacement, shuffle, seed),
GetOutput::same_type(),
)
.with_fmt("shuffle")
.with_fmt("sample_frac")
}

#[cfg(feature = "ewma")]
Expand All @@ -2038,7 +2038,7 @@ impl Expr {
_ => Float64,
}),
)
.with_fmt("emw_mean")
.with_fmt("ewm_mean")
}

#[cfg(feature = "ewma")]
Expand All @@ -2051,7 +2051,7 @@ impl Expr {
_ => Float64,
}),
)
.with_fmt("emw_std")
.with_fmt("ewm_std")
}

#[cfg(feature = "ewma")]
Expand All @@ -2064,7 +2064,7 @@ impl Expr {
_ => Float64,
}),
)
.with_fmt("emw_var")
.with_fmt("ewm_var")
}

/// Check if any boolean value is `true`
Expand Down Expand Up @@ -2189,7 +2189,7 @@ impl Expr {
}
}),
)
.with_fmt("log")
.with_fmt("exp")
}

#[cfg(feature = "log")]
Expand Down
14 changes: 7 additions & 7 deletions py-polars/polars/internals/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3191,7 +3191,7 @@ def groupby_dynamic(
┌─────────────────────┬─────┐
│ time ┆ n │
│ --- ┆ --- │
│ datetime[ns] ┆ i64 │
│ datetime[μs] ┆ i64 │
╞═════════════════════╪═════╡
│ 2021-12-16 00:00:00 ┆ 0 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┤
Expand Down Expand Up @@ -3222,7 +3222,7 @@ def groupby_dynamic(
┌─────────────────────┬─────────────────────┬─────────────────────┐
│ time ┆ time_min ┆ time_max │
│ --- ┆ --- ┆ --- │
│ datetime[ns] ┆ datetime[ns] ┆ datetime[ns] │
│ datetime[μs] ┆ datetime[μs] ┆ datetime[μs] │
╞═════════════════════╪═════════════════════╪═════════════════════╡
│ 2021-12-16 00:00:00 ┆ 2021-12-16 00:00:00 ┆ 2021-12-16 00:00:00 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
Expand All @@ -3244,7 +3244,7 @@ def groupby_dynamic(
┌─────────────────────┬─────────────────────┬─────────────────────┬────────────┐
│ _lower_boundary ┆ _upper_boundary ┆ time ┆ time_count │
│ --- ┆ --- ┆ --- ┆ --- │
│ datetime[ns] ┆ datetime[ns] ┆ datetime[ns] ┆ u32 │
│ datetime[μs] ┆ datetime[μs] ┆ datetime[μs] ┆ u32 │
╞═════════════════════╪═════════════════════╪═════════════════════╪════════════╡
│ 2021-12-15 23:00:00 ┆ 2021-12-16 00:00:00 ┆ 2021-12-16 00:00:00 ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
Expand All @@ -3270,7 +3270,7 @@ def groupby_dynamic(
┌─────────────────────┬────────────┬─────────────────────────────────────┐
│ time ┆ time_count ┆ time_agg_list │
│ --- ┆ --- ┆ --- │
│ datetime[ns] ┆ u32 ┆ list[datetime[ns]] │
│ datetime[μs] ┆ u32 ┆ list[datetime[μs]] │
╞═════════════════════╪════════════╪═════════════════════════════════════╡
│ 2021-12-16 00:00:00 ┆ 2 ┆ [2021-12-16 00:00:00, 2021-12-16... │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
Expand All @@ -3292,7 +3292,7 @@ def groupby_dynamic(
┌─────────────────────┬────────────┐
│ time ┆ time_count │
│ --- ┆ --- │
│ datetime[ns] ┆ u32 │
│ datetime[μs] ┆ u32 │
╞═════════════════════╪════════════╡
│ 2021-12-16 00:00:00 ┆ 1 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
Expand Down Expand Up @@ -3322,7 +3322,7 @@ def groupby_dynamic(
┌─────────────────────┬────────┐
│ time ┆ groups │
│ --- ┆ --- │
│ datetime[ns] ┆ str │
│ datetime[μs] ┆ str │
╞═════════════════════╪════════╡
│ 2021-12-16 00:00:00 ┆ a │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
Expand Down Expand Up @@ -3351,7 +3351,7 @@ def groupby_dynamic(
┌────────┬─────────────────────┬─────────────────────┬─────────────────────┬────────────┐
│ groups ┆ _lower_boundary ┆ _upper_boundary ┆ time ┆ time_count │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ str ┆ datetime[ns] ┆ datetime[ns] ┆ datetime[ns] ┆ u32 │
│ str ┆ datetime[μs] ┆ datetime[μs] ┆ datetime[μs] ┆ u32 │
╞════════╪═════════════════════╪═════════════════════╪═════════════════════╪════════════╡
│ a ┆ 2021-12-15 23:00:00 ┆ 2021-12-16 00:00:00 ┆ 2021-12-16 00:00:00 ┆ 1 │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
Expand Down

0 comments on commit a8d131c

Please sign in to comment.