From 5d1ce251dd61acefca119ec99cf62c121ec543f4 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:24:03 +0100 Subject: [PATCH] Bump version to 0.7.14 --- docs/installation.md | 2 +- narwhals/__init__.py | 2 +- narwhals/translate.py | 13 ++++++++++--- pyproject.toml | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 1f8ecd7de..b7017e815 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -11,6 +11,6 @@ Then, if you start the Python REPL and see the following: ```python >>> import narwhals >>> narwhals -'0.7.12' +'0.7.14' ``` then installation worked correctly! diff --git a/narwhals/__init__.py b/narwhals/__init__.py index 5e08484b0..e9f7c896a 100644 --- a/narwhals/__init__.py +++ b/narwhals/__init__.py @@ -27,7 +27,7 @@ from narwhals.translate import from_native from narwhals.translate import to_native -__version__ = "0.7.12" +__version__ = "0.7.14" __all__ = [ "concat", diff --git a/narwhals/translate.py b/narwhals/translate.py index 652b1403b..caaad511b 100644 --- a/narwhals/translate.py +++ b/narwhals/translate.py @@ -16,12 +16,15 @@ from narwhals.series import Series -def to_native(narwhals_object: LazyFrame | DataFrame | Series) -> Any: +def to_native( + narwhals_object: LazyFrame | DataFrame | Series, *, strict: bool = True +) -> Any: """ Convert Narwhals object to native one. Arguments: narwhals_object: Narwhals object. + strict: whether to raise on non-Narwhals input. Returns: Object of class that user started with. @@ -42,8 +45,12 @@ def to_native(narwhals_object: LazyFrame | DataFrame | Series) -> Any: else narwhals_object._series._series ) - msg = f"Expected Narwhals object, got {type(narwhals_object)}." # pragma: no cover - raise TypeError(msg) # pragma: no cover + if strict: # pragma: no cover (todo) + msg = ( + f"Expected Narwhals object, got {type(narwhals_object)}." # pragma: no cover + ) + raise TypeError(msg) # pragma: no cover + return narwhals_object # pragma: no cover (todo) @overload diff --git a/pyproject.toml b/pyproject.toml index b6122eb97..ced9c21af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "narwhals" -version = "0.7.12" +version = "0.7.14" authors = [ { name="Marco Gorelli", email="33491632+MarcoGorelli@users.noreply.github.com" }, ]