-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functional to OOP refactor for fetch_issues method #105
Open
JacobCWBillings
wants to merge
20
commits into
main
Choose a base branch
from
bounties/jcwb_00
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
be0fb2d
Functional to OOP refactor for fetch_issues method
JacobCWBillings fe6884d
retest functional to OOP refactor, fetch_issues method
JacobCWBillings 9ee4747
test functional to OOP refactor, fetch_issues method
JacobCWBillings 6b12419
test functional to OOP refactor, fetch_issues method
JacobCWBillings 549699b
lint code
JacobCWBillings 3278cd5
lint code
JacobCWBillings 4d2f753
Draft commit, Bounty 2
JacobCWBillings ef4da20
Draft commit, Bounty 2
JacobCWBillings db159cc
Draft commit, Bounty 2, bug fix
JacobCWBillings 4d6e3f6
Draft commit, Bounty 2, Linted
JacobCWBillings 1cbbf69
Bounty 2 commit. Tested. Linted.
JacobCWBillings 06fa34e
Bounty 2 commit. Tested. Linted.
JacobCWBillings 01fed3d
Bounty 1 (&2) recommended fixes.
JacobCWBillings 3dc679d
Bounty 1 (&2) recommended fixes, + bug fixes
JacobCWBillings fe72a60
Bounty 1 (&2) recommended fixes, + bug fixes.
JacobCWBillings cd9d8b6
Bounty 1 (&2), add fetch_raw_issue_ids.
JacobCWBillings 345805b
Bounty 1 (&2), add fetch_raw_issue_ids (v02)
JacobCWBillings f290eb8
Bounty 1 (&2) optimize fetch_raw_issue_ids.
JacobCWBillings 187cfa5
^_ ^
JacobCWBillings 90fae80
^_ ^ (Lint remove whitespace)
JacobCWBillings File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# flake8: noqa | ||
from .comments import fetch_comments | ||
from .commit import fetch_commits | ||
from .issues import fetch_issues | ||
from .github_extraction import GithubExtraction | ||
from .pull_requests import fetch_pull_requests |
39 changes: 39 additions & 0 deletions
39
dags/hivemind_etl_helpers/src/db/github/extract/github_extraction.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from datetime import datetime | ||
|
||
import neo4j | ||
from hivemind_etl_helpers.src.db.github.extract.issues import GithubIssueExtraction | ||
from hivemind_etl_helpers.src.db.github.schema import GitHubIssue | ||
|
||
|
||
class GithubExtraction: | ||
def __init__(self): | ||
# to be uncommented once other pull requests | ||
# regarding `extraction` are ready | ||
# self.commits_extraction = GithubCommitExtraction() | ||
# self.pull_requests_extraction = GithubPullRequestsExtraction() | ||
# self.comment_extraction = GitHubCommentExtraction() | ||
self.issue_extraction = GithubIssueExtraction() | ||
|
||
def _fetch_raw_issues( | ||
self, repository_id: list[int], from_date: datetime | None = None, **kwargs | ||
) -> list[neo4j._data.Record]: | ||
return self.issue_extraction._fetch_raw_issues( | ||
repository_id, from_date, **kwargs | ||
) | ||
|
||
def fetch_issues( | ||
self, repository_id: list[int], from_date: datetime | None = None, **kwargs | ||
) -> list[GitHubIssue]: | ||
return self.issue_extraction.fetch_issues(repository_id, from_date, **kwargs) | ||
|
||
def _fetch_raw_issue_ids( | ||
self, repository_id: list[int], from_date: datetime | None = None, **kwargs | ||
) -> list[neo4j._data.Record]: | ||
return self.issue_extraction._fetch_raw_issue_ids( | ||
repository_id, from_date, **kwargs | ||
) | ||
|
||
def fetch_issue_ids( | ||
amindadgar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
self, repository_id: list[int], from_date: datetime | None = None, **kwargs | ||
) -> list[GitHubIssue]: | ||
return self.issue_extraction.fetch_issue_ids(repository_id, from_date, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# flake8: noqa | ||
from .comment import GitHubComment | ||
from .commit import GitHubCommit | ||
from .issue import GitHubIssue | ||
from .issue import GitHubIssue, GitHubIssueID | ||
from .pull_request import GitHubPullRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this as we wouldn't use it directly.