Skip to content

Commit 90ad973

Browse files
committed
nicer error handling, not there yet
1 parent c4611fe commit 90ad973

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

narwhals/translate.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import datetime as dt
4-
import sys
54
from decimal import Decimal
65
from functools import wraps
76
from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar, overload
@@ -544,16 +543,16 @@ def _from_native_impl( # noqa: C901, PLR0911, PLR0912, PLR0915
544543
obj = plugin.load()
545544
frame = obj.dataframe.DaftLazyFrame
546545

547-
#from obj.dataframe import DaftLazyFrame
546+
#from obj.dataframe import DaftLazyFrame doesn't work directly!
548547
try:
549548
df_compliant = frame(native_object, version=Version.MAIN)
550549
return df_compliant.to_narwhals()
551550
# @mp: not sure if correct exception, check. Improve error message
552-
except TypeError as e:
553-
print(f'Cannot read it the dataframe, reason {e}. Currently only supporting daft plugins')
551+
except TypeError as e:
552+
print(f"Cannot read it the dataframe, reason {e}. Currently only supporting daft plugins")
554553
# try the next plugin
555554
continue
556-
555+
557556
"""
558557
TODO @mp: need logic to go over all the entry points found, and if daft found,
559558
(others later), we return the daft dataframe from_native. I think the transformation has

0 commit comments

Comments
 (0)