Make sure content_type exists (#1938)

This commit is contained in:
bogdankostic 2022-01-03 17:00:31 +01:00 committed by GitHub
parent c85ac2baec
commit 202ef276ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,6 @@ import logging
import json import json
import numpy as np import numpy as np
from tqdm import tqdm from tqdm import tqdm
import pandas as pd
from haystack.schema import Document from haystack.schema import Document
from haystack.document_stores import BaseDocumentStore from haystack.document_stores import BaseDocumentStore
@ -220,6 +219,7 @@ class WeaviateDocumentStore(BaseDocumentStore):
# Converting JSON-string to original datatype (string or nested list) # Converting JSON-string to original datatype (string or nested list)
content = json.loads(str(props.get(self.content_field))) content = json.loads(str(props.get(self.content_field)))
content_type = None
if props.get("contenttype") is not None: if props.get("contenttype") is not None:
content_type = str(props.pop("contenttype")) content_type = str(props.pop("contenttype"))