Return stripped value from get_embeddable_data if its string
This commit is contained in:
parent
adc8a0b09c
commit
e794bb8834
1 changed files with 5 additions and 2 deletions
|
|
@ -20,5 +20,8 @@ class DataPoint(BaseModel):
|
||||||
def get_embeddable_data(self):
|
def get_embeddable_data(self):
|
||||||
if self._metadata and len(self._metadata["index_fields"]) > 0 \
|
if self._metadata and len(self._metadata["index_fields"]) > 0 \
|
||||||
and hasattr(self, self._metadata["index_fields"][0]):
|
and hasattr(self, self._metadata["index_fields"][0]):
|
||||||
|
attribute = getattr(self, self._metadata["index_fields"][0])
|
||||||
return getattr(self, self._metadata["index_fields"][0])
|
if isinstance(attribute, str):
|
||||||
|
return(attribute.strip())
|
||||||
|
else:
|
||||||
|
return (attribute)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue