|
56 | 56 | no_default, |
57 | 57 | normalize_filepath, |
58 | 58 | parse_version, |
| 59 | + qualified_type_name, |
59 | 60 | scale_bytes, |
60 | 61 | warn_null_comparison, |
61 | 62 | ) |
@@ -4935,7 +4936,7 @@ def insert_column(self, index: int, column: IntoExprColumn) -> DataFrame: |
4935 | 4936 | cols.insert(index, column) # type: ignore[arg-type] |
4936 | 4937 | self._df = self.select(cols)._df |
4937 | 4938 | else: |
4938 | | - msg = f"column must be a Series or Expr, got {column!r} (type={type(column)})" |
| 4939 | + msg = f"column must be a Series or Expr, got {column!r} (type={qualified_type_name(column)})" |
4939 | 4940 | raise TypeError(msg) |
4940 | 4941 | return self |
4941 | 4942 |
|
@@ -7505,19 +7506,21 @@ def join_asof( |
7505 | 7506 | └─────────────┴────────────┴────────────┴──────┘ |
7506 | 7507 | """ |
7507 | 7508 | if not isinstance(other, DataFrame): |
7508 | | - msg = f"expected `other` join table to be a DataFrame, got {type(other).__name__!r}" |
| 7509 | + msg = f"expected `other` join table to be a DataFrame, not {qualified_type_name(other)!r}" |
7509 | 7510 | raise TypeError(msg) |
7510 | 7511 |
|
7511 | 7512 | if on is not None: |
7512 | 7513 | if not isinstance(on, (str, pl.Expr)): |
7513 | | - msg = f"expected `on` to be str or Expr, got {type(on).__name__!r}" |
| 7514 | + msg = ( |
| 7515 | + f"expected `on` to be str or Expr, got {qualified_type_name(on)!r}" |
| 7516 | + ) |
7514 | 7517 | raise TypeError(msg) |
7515 | 7518 | else: |
7516 | 7519 | if not isinstance(left_on, (str, pl.Expr)): |
7517 | | - msg = f"expected `left_on` to be str or Expr, got {type(left_on).__name__!r}" |
| 7520 | + msg = f"expected `left_on` to be str or Expr, got {qualified_type_name(left_on)!r}" |
7518 | 7521 | raise TypeError(msg) |
7519 | 7522 | elif not isinstance(right_on, (str, pl.Expr)): |
7520 | | - msg = f"expected `right_on` to be str or Expr, got {type(right_on).__name__!r}" |
| 7523 | + msg = f"expected `right_on` to be str or Expr, got {qualified_type_name(right_on)!r}" |
7521 | 7524 | raise TypeError(msg) |
7522 | 7525 |
|
7523 | 7526 | return ( |
@@ -7751,7 +7754,7 @@ def join( |
7751 | 7754 | For joining on columns with categorical data, see :class:`polars.StringCache`. |
7752 | 7755 | """ |
7753 | 7756 | if not isinstance(other, DataFrame): |
7754 | | - msg = f"expected `other` join table to be a DataFrame, got {type(other).__name__!r}" |
| 7757 | + msg = f"expected `other` join table to be a DataFrame, not {qualified_type_name(other)!r}" |
7755 | 7758 | raise TypeError(msg) |
7756 | 7759 |
|
7757 | 7760 | return ( |
@@ -7840,7 +7843,7 @@ def join_where( |
7840 | 7843 | └─────┴─────┴─────┴───────┴──────┴──────┴──────┴─────────────┘ |
7841 | 7844 | """ |
7842 | 7845 | if not isinstance(other, DataFrame): |
7843 | | - msg = f"expected `other` join table to be a DataFrame, got {type(other).__name__!r}" |
| 7846 | + msg = f"expected `other` join table to be a DataFrame, not {qualified_type_name(other)!r}" |
7844 | 7847 | raise TypeError(msg) |
7845 | 7848 |
|
7846 | 7849 | return ( |
@@ -10864,7 +10867,7 @@ def row( |
10864 | 10867 |
|
10865 | 10868 | elif by_predicate is not None: |
10866 | 10869 | if not isinstance(by_predicate, pl.Expr): |
10867 | | - msg = f"expected `by_predicate` to be an expression, got {type(by_predicate).__name__!r}" |
| 10870 | + msg = f"expected `by_predicate` to be an expression, got {qualified_type_name(by_predicate)!r}" |
10868 | 10871 | raise TypeError(msg) |
10869 | 10872 | rows = self.filter(by_predicate).rows() |
10870 | 10873 | n_rows = len(rows) |
|
0 commit comments