Skip to content

Commit

Permalink
Update warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Oct 23, 2023
1 parent a63c91a commit a7e3cad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion py-polars/polars/expr/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -2104,5 +2104,5 @@ def _validate_format_argument(format: str | None) -> None:
" See the full specification: https://docs.rs/chrono/latest/chrono/format/strftime"
)
warnings.warn(
message, category=ChronoFormatWarning, stacklevel=find_stacklevel()
message, ChronoFormatWarning, stacklevel=find_stacklevel()
)
14 changes: 5 additions & 9 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import contextlib
import os
import warnings
from collections import OrderedDict
from datetime import date, datetime, time, timedelta
from functools import reduce
Expand Down Expand Up @@ -72,7 +71,6 @@
_in_notebook,
_prepare_row_count_args,
_process_null_values,
find_stacklevel,
is_bool_sequence,
is_sequence,
normalize_filepath,
Expand Down Expand Up @@ -3439,17 +3437,15 @@ def group_by_dynamic(
""" # noqa: W505
if truncate is not None:
issue_deprecation_warning(
f"`truncate` is deprecated and will be removed in a future version."
f" Please replace `truncate={truncate}` with `label='{label}'` to silence this warning.",
version="0.19.4",
)
if truncate:
label = "left"
else:
label = "datapoint"
warnings.warn(
f"`truncate` is deprecated and will be removed in a future version. "
f"Please replace `truncate={truncate}` with `label='{label}'` to "
"silence this warning.",
DeprecationWarning,
stacklevel=find_stacklevel(),
)

index_column = parse_as_expression(index_column)
if offset is None:
Expand Down

0 comments on commit a7e3cad

Please sign in to comment.