feat: add setter to dataframe to handle missing text_keys (#6785)
* update the templates and add error handling * [autofix.ci] apply automated fixes * updated changes * update to template from main * Update split_text.py * Add validation for text key in DataFrame setter --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
parent
8f276ad94c
commit
38c895994a
1 changed files with 3 additions and 0 deletions
|
|
@ -72,6 +72,9 @@ class DataFrame(pandas_DataFrame):
|
|||
|
||||
@text_key.setter
|
||||
def text_key(self, value: str) -> None:
|
||||
if value not in self.columns:
|
||||
msg = f"Text key '{value}' not found in DataFrame columns"
|
||||
raise ValueError(msg)
|
||||
self._text_key = value
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue