L ix<ddlmZddlmZerddlmZmZGddeZGdde Z Gdd e eZ Gd d eZ Gd d eZ GddeZGddeZGddeZGddeeZGddeZGddeZGddeZy)) annotations) TYPE_CHECKING) CollectionIterableceZdZdZy) NarwhalsErrorz'Base class for all Narwhals exceptions.N__name__ __module__ __qualname____doc__Y/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/narwhals/exceptions.pyrr s1rrc eZdZdZddZddZy)FormattedKeyErrora7KeyError with formatted error message. Python's `KeyError` has special casing around formatting (see https://bugs.python.org/issue2651). Use this class when the error message has newlines and other special format characters. Needed by https://github.com/tensorflow/tensorflow/issues/36857. c||_yNmessage)selfrs r__init__zFormattedKeyError.__init__s  rc|jSrr)rs r__str__zFormattedKeyError.__str__s ||rNrstrreturnNone)rr)r r r r rrrrrrr srrc\eZdZdZdfd Ze ddZe ddZxZS)ColumnNotFoundErrorz0Exception raised when column name isn't present.cF||_t| |jyrrsuperrrr __class__s rrzColumnNotFoundError.__init__   &rcNdt|dt|d}t|S)Nz&The following columns were not found: z+ Hint: Did you mean one of these columns: ?)sortedlistr )clsmissing_columnsavailable_columnsrs r'from_missing_and_available_column_namesz;ColumnNotFoundError.from_missing_and_available_column_names$s: 5VO5L4M;DARException raised when object can't be converted to expression.cF||_t| |jyrr"r$s rrzInvalidIntoExprError.__init__Pr&rc$d|d}t|S)NzBExpected an object which can be converted into an expression, got a Hint: - if you were trying to select a column which does not have a string column name, then you should explicitly use `nw.col`. For example, `df.select(nw.col(0))` if you have a column named `0`. - if you were trying to create a new literal column, then you should explicitly use `nw.lit`. For example, `df.select(nw.lit(0))` if you want to create a new column with literal value `0`.)rA)r+ invalid_typers rfrom_invalid_typez&InvalidIntoExprError.from_invalid_typeTs+QQ]P^_/ / $G,,rr)r+typerDrFrrA)r r r r rr2rEr3r4s@rrArAMsH' - -rrAceZdZdZy)UnsupportedDTypeErrorz_Exception raised when trying to convert to a DType which is not supported by the given backend.Nr rrrrHrHdr9rrHceZdZdZy)NarwhalsUnstableWarningzRWarning issued when a method or function is considered unstable in the stable api.Nr rrrrJrJhs\rrJc eZdZy)PerformanceWarningN)r r r rrrrLrLlsrrLN) __future__rtypingrcollections.abcrr ValueErrorrKeyErrorrr r6r8r;r=r? TypeErrorrArH UserWarningrJWarningrLrrrrUs" 42J2   ,+],8S=SjjVVA]A6M6-9m-.jMj]k]'&r