Skip to content

Commit

Permalink
remove redundant if/else from imports (run-llama#524)
Browse files Browse the repository at this point in the history
Remove redundant if/else from imports in github repo/issues reader
  • Loading branch information
rwood-97 authored Sep 20, 2023
1 parent c9767b1 commit 2c80cdc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
38 changes: 12 additions & 26 deletions llama_hub/github_repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,18 @@
from llama_index.readers.schema.base import Document


if "pytest" in sys.modules:
from llama_hub.github_repo.github_client import (
BaseGithubClient,
GitBranchResponseModel,
GitCommitResponseModel,
GithubClient,
GitTreeResponseModel,
)
from llama_hub.github_repo.utils import (
BufferedGitBlobDataIterator,
print_if_verbose,
get_file_extension,
)
else:
from llama_hub.github_repo.github_client import (
BaseGithubClient,
GithubClient,
GitBranchResponseModel,
GitCommitResponseModel,
GitTreeResponseModel,
)
from llama_hub.github_repo.utils import (
BufferedGitBlobDataIterator,
print_if_verbose,
get_file_extension,
)
from llama_hub.github_repo.github_client import (
BaseGithubClient,
GitBranchResponseModel,
GitCommitResponseModel,
GithubClient,
GitTreeResponseModel,
)
from llama_hub.github_repo.utils import (
BufferedGitBlobDataIterator,
print_if_verbose,
get_file_extension,
)

logger = logging.getLogger(__name__)

Expand Down
15 changes: 4 additions & 11 deletions llama_hub/github_repo_issues/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,10 @@
from llama_index.readers.base import BaseReader
from llama_index.readers.schema.base import Document

if "pytest" in sys.modules:
from llama_hub.github_repo_issues.github_client import (
BaseGitHubIssuesClient,
GitHubIssuesClient,
)
else:
from llama_hub.github_repo_issues.github_client import (
BaseGitHubIssuesClient,
GitHubIssuesClient,
)

from llama_hub.github_repo_issues.github_client import (
BaseGitHubIssuesClient,
GitHubIssuesClient,
)

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 2c80cdc

Please sign in to comment.