TogetherCrew / airflow-dags

1 stars 1 forks source link

[Hivemind] Refactor Github pull request extraction functions to object orientated code #99

Open cyri113 opened 7 months ago

cyri113 commented 7 months ago

Part of the Github Vectorize (Summary). Please read this document before starting.

This task consists or refactoring a part of the code from functional programming to object-orientated code.

The following changes should be implemented in dags/hivemind_etl_helpers/src/db/github/extract.

### Tasks
- [ ] Create a class `GithubPullRequestExtraction`
- [ ] Migrate `fetch_raw_pull_requests` to a private method `_fetch_raw_pull_requests` in `GithubPullRequestExtraction`
- [ ] Migrate the `fetch_pull_requests` to a private method `fetch_pull_requests` in `GithubPullRequestExtraction`
- [ ] Make the class `GithubExtraction` inherit `GithubPullRequestExtraction`
- [ ] Update the code base to use the `GithubPullRequestExtraction.fetch_pull_requests` instead of the `fetch_pull_requests`
- [ ] Update the test cases

Note: file coverage should be 100%.