|  | 
| 27 | 27 |     cast, | 
| 28 | 28 |     overload, | 
| 29 | 29 | ) | 
| 30 |  | -from typing_extensions import TypeAlias | 
| 31 | 30 | 
 | 
| 32 | 31 | import jsonschema | 
| 33 | 32 | import jsonschema.exceptions | 
| 34 | 33 | import jsonschema.validators | 
| 35 | 34 | import narwhals.stable.v1 as nw | 
|  | 35 | +from narwhals.stable.v1.dependencies import is_narwhals_series | 
| 36 | 36 | from packaging.version import Version | 
| 37 | 37 | 
 | 
| 38 | 38 | if sys.version_info >= (3, 12): | 
|  | 
| 58 | 58 |         from typing import Never, Self | 
| 59 | 59 |     else: | 
| 60 | 60 |         from typing_extensions import Never, Self | 
|  | 61 | +    if sys.version_info >= (3, 10): | 
|  | 62 | +        from typing import TypeAlias | 
|  | 63 | +    else: | 
|  | 64 | +        from typing_extensions import TypeAlias | 
|  | 65 | + | 
| 61 | 66 |     _OptionalModule: TypeAlias = "ModuleType | None" | 
| 62 | 67 | 
 | 
| 63 | 68 | ValidationErrorList: TypeAlias = list[jsonschema.exceptions.ValidationError] | 
| @@ -493,11 +498,10 @@ def _subclasses(cls: type[Any]) -> Iterator[type[Any]]: | 
| 493 | 498 | 
 | 
| 494 | 499 | 
 | 
| 495 | 500 | def _from_array_like(obj: Iterable[Any], /) -> list[Any]: | 
| 496 |  | -    try: | 
| 497 |  | -        ser = nw.from_native(obj, series_only=True) | 
| 498 |  | -        return ser.to_list() | 
| 499 |  | -    except TypeError: | 
| 500 |  | -        return list(obj) | 
|  | 501 | +    # TODO @dangotbanned: Review after available (https://github.com/narwhals-dev/narwhals/pull/2110) | 
|  | 502 | +    # See for what this silences for `narwhals` CI (https://github.com/narwhals-dev/narwhals/pull/2110#issuecomment-2687936504) | 
|  | 503 | +    maybe_ser: Any = nw.from_native(obj, pass_through=True) | 
|  | 504 | +    return maybe_ser.to_list() if is_narwhals_series(maybe_ser) else list(obj) | 
| 501 | 505 | 
 | 
| 502 | 506 | 
 | 
| 503 | 507 | def _from_date_datetime(obj: dt.date | dt.datetime, /) -> dict[str, Any]: | 
|  | 
0 commit comments