Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove logging statement of setting ID manually in Document #4129

Merged
merged 3 commits into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions haystack/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ def __init__(
If model's `scale_score` was set to True (default) score is in the unit interval (range of [0,1]), where 1 means extremely relevant.
:param meta: Meta fields for a document like name, url, or author in the form of a custom dict (any keys and values allowed).
:param embedding: Vector encoding of the text
:param id_hash_keys: Generate the document id from a custom list of strings that refere to the documents attributes.
If you want ensure you don't have duplicate documents in your DocumentStore but texts are
not unique, you can modify the metadata and pass e.g. "meta" to this field (e.g. ["content", "meta"]).
In this case the id will be generated by using the content and the defined metadata.
:param id_hash_keys: Generate the document id from a custom list of strings that refer to the document's attributes.
To ensure you don't have duplicate documents in your DocumentStore if texts are
not unique, modify the metadata and pass, for example, "meta" to this field (example: ["content", "meta"]).
In this case, the id is generated by using the content and the defined metadata.
If you specify a custom ID for the `id` parameter, the `id_hash_keys` parameter is
ignored and the custom ID is used.
"""

if content is None:
Expand Down Expand Up @@ -115,10 +117,6 @@ def __init__(

# Create a unique ID (either new one, or one from user input)
if id is not None:
logger.info(
"Setting the ID manually. This might cause a mismatch with the ID "
"that would be generated from the document content and id_hash_keys value."
)
self.id: str = str(id)
else:
self.id: str = self._get_id(id_hash_keys=id_hash_keys)
Expand Down