Skip to content

Commit

Permalink
passing local from extract function
Browse files Browse the repository at this point in the history
emcf committed Apr 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 7ebd512 commit 4bb2a90
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_thepipe.py
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ def test_save_outputs(self):
self.assertTrue(any('.jpg' in f for f in os.listdir(self.outputs_directory)))

def test_extract(self):
chunks = thepipe.extract(source=self.files_directory+"/example.md")
chunks = thepipe.extract(source=self.files_directory+"/example.md", local=True)
self.assertEqual(type(chunks), list)
self.assertNotEqual(len(chunks), 0)
self.assertEqual(type(chunks[0]), dict)
2 changes: 1 addition & 1 deletion thepipe_api/extractor.py
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ def extract_from_source(source: str, match: Optional[str] = None, ignore: Option
elif source_type == SourceTypes.GITHUB:
return extract_github(github_url=source, file_path='', match=match, ignore=ignore, text_only=text_only, verbose=verbose, ai_extraction=ai_extraction, branch='master')
elif source_type == SourceTypes.URL:
return extract_url(url=source, text_only=text_only)
return extract_url(url=source, text_only=text_only, local=local)
elif source_type == SourceTypes.ZIP:
return extract_zip(file_path=source, match=match, ignore=ignore, verbose=verbose, ai_extraction=ai_extraction, text_only=text_only)
return extract_from_file(file_path=source, source_type=source_type, verbose=verbose, ai_extraction=ai_extraction, text_only=text_only, local=local)

0 comments on commit 4bb2a90

Please sign in to comment.