Skip to content

Commit 495d727

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 76232df commit 495d727

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

narwhals/_polars/dataframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
NativePolarsFrame = TypeVar("NativePolarsFrame", pl.DataFrame, pl.LazyFrame)
9797

9898
# @mp: can we make a class here which is more generic than all the other framework specif frames?
99-
# then have the other frames inherit from this, but it should be generic enough that we can use
100-
# it also to read plugins?
99+
# then have the other frames inherit from this, but it should be generic enough that we can use
100+
# it also to read plugins?
101101

102102

103103
class PolarsBaseFrame(Generic[NativePolarsFrame]):

narwhals/translate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,12 @@ def _from_native_impl( # noqa: C901, PLR0911, PLR0912, PLR0915
506506
raise TypeError(msg)
507507
return native_object
508508
return ns_spark.compliant.from_native(native_object).to_narwhals()
509-
510-
'''
509+
510+
"""
511511
@mp: need function here which can read frames as long as they're of the type provided
512512
in the plugins. that could then be called below
513513
how to make it generic enough but not so generic as to break downsteam..
514-
'''
515-
514+
"""
516515

517516
# Interchange protocol
518517
if _supports_dataframe_interchange(native_object):
@@ -546,17 +545,18 @@ def _from_native_impl( # noqa: C901, PLR0911, PLR0912, PLR0915
546545
discovered_plugins = entry_points(group="narwhals.plugins")
547546

548547
for plugin in discovered_plugins:
549-
550548
obj = plugin.load()
551549
frame = obj.dataframe.DaftLazyFrame
552550

553-
#from obj.dataframe import DaftLazyFrame doesn't work directly!
551+
# from obj.dataframe import DaftLazyFrame doesn't work directly!
554552
try:
555553
df_compliant = frame(native_object, version=Version.MAIN)
556554
return df_compliant.to_narwhals()
557555
# @mp: not sure if correct exception, check. Improve error message
558556
except TypeError as e:
559-
print(f"Cannot read in the dataframe, reason {e}. Currently only supporting daft plugins")
557+
print(
558+
f"Cannot read in the dataframe, reason {e}. Currently only supporting daft plugins"
559+
)
560560
# try the next plugin
561561
continue
562562

0 commit comments

Comments
 (0)