mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 23:13:31 +00:00
community[patch]: Change github endpoint in GithubLoader (#17622)
Description- - Changed the GitHub endpoint as existing was not working and giving 404 not found error - Also the existing function was failing if file_filter is not passed as the tree api return all paths including directory as well, and when get_file_content was iterating over these path, the function was failing for directory as the api was returning list of files inside the directory, so added a condition to ignore the paths if it a directory - Fixes this issue - https://github.com/langchain-ai/langchain/issues/17453 Co-authored-by: Radhika Bansal <Radhika.Bansal@veritas.com>
This commit is contained in:
@@ -147,7 +147,7 @@ def test_github_file_content_get_file_paths(mocker: MockerFixture) -> None:
|
||||
"type": "blob",
|
||||
"sha": "789",
|
||||
"size": 37,
|
||||
"url": "https://github.com/api/v3/repos/shufanhao/langchain/git/blobs/789",
|
||||
"url": "https://github.com/repos/shufanhao/langchain/git/blobs/789",
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -206,7 +206,7 @@ def test_github_file_content_loader(mocker: MockerFixture) -> None:
|
||||
"type": "blob",
|
||||
"sha": "789",
|
||||
"size": 37,
|
||||
"url": "https://github.com/api/v3/repos/shufanhao/langchain/git/blobs/789",
|
||||
"url": "https://github.com/repos/shufanhao/langchain/git/blobs/789",
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Reference in New Issue
Block a user