1
0
mirror of synced 2025-12-25 11:06:55 -05:00

Source Github: Raise Error if no organizations or repos are available (#21084)

* Source Github: Raise Error if no organizations or repos are available

* Source GitHub: Update docs; bump version

* Source GitHub: Add test

* Source GitHub: Exclude empty streams

* auto-bump connector version

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
This commit is contained in:
Artem Inzhyyants
2023-01-06 19:50:23 +01:00
committed by GitHub
parent 6c2ee304aa
commit 49bee81fc2
7 changed files with 74 additions and 52 deletions

View File

@@ -176,6 +176,8 @@ class SourceGithub(AbstractSource):
def streams(self, config: Mapping[str, Any]) -> List[Stream]:
authenticator = self._get_authenticator(config)
organizations, repositories = self._get_org_repositories(config=config, authenticator=authenticator)
if not any((organizations, repositories)):
raise Exception("No streams available. Please check permissions")
page_size = config.get("page_size_for_large_streams", DEFAULT_PAGE_SIZE_FOR_LARGE_STREAM)
organization_args = {"authenticator": authenticator, "organizations": organizations}