Skip to content

Commit acd96b4

Browse files
Add inline pandas import and missing dunder methods to lazy import proxy
1 parent e1b746e commit acd96b4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/lfx/src/lfx/base/tools/component_tool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ def output_function(*args, **kwargs):
135135
return result.get_text()
136136
if isinstance(result, Data):
137137
return result.data
138+
import pandas as pd
139+
138140
if isinstance(result, pd.DataFrame):
139141
return result
140142
# removing the model_dump() call here because it is not serializable
@@ -190,6 +192,8 @@ async def output_function(*args, **kwargs):
190192
return result.get_text()
191193
if isinstance(result, Data):
192194
return result.data
195+
import pandas as pd
196+
193197
if isinstance(result, pd.DataFrame):
194198
return result
195199
# removing the model_dump() call here because it is not serializable

src/lfx/src/lfx/custom/validate.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,12 @@ def __subclasscheck__(self, subclass):
616616
def __iter__(self):
617617
return iter(self._resolve())
618618

619+
def __or__(self, other):
620+
return self._resolve() | other
621+
622+
def __ror__(self, other):
623+
return other | self._resolve()
624+
619625
def __repr__(self) -> str:
620626
# Intentionally does NOT resolve — useful for logging while debugging the lazy path
621627
# without forcing every `repr()` to import the underlying module.

0 commit comments

Comments
 (0)