Skip to content

Commit

Permalink
Update integrations/unstructured/src/haystack_integrations/components…
Browse files Browse the repository at this point in the history
…/converters/unstructured/converter.py

Co-authored-by: Stefano Fiorucci <[email protected]>
  • Loading branch information
Corentin and anakin87 authored Feb 5, 2024
1 parent 0199e3c commit 7358a0a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ def run(
filepaths_in_directories = [
filepath for path in paths_obj if path.is_dir() for filepath in path.glob("*.*") if filepath.is_file()
]
if filepaths_in_directories != [] and isinstance(meta, list):
error = """For directories as path metadata can only be a unique dictionary, not a list.
To provide different metadata (list) for each files,
please provide an explicit list of direct paths instead."""
if filepaths_in_directories and isinstance(meta, list):
error = """"If providing directories in the `paths` parameter,
`meta` can only be a dictionary (metadata applied to every file),
and not a list. To specify different metadata for each file,
provide an explicit list of direct paths instead."""
raise ValueError(error)

all_filepaths = filepaths + filepaths_in_directories
Expand Down

0 comments on commit 7358a0a

Please sign in to comment.