TogetherCrew / airflow-dags

1 stars 1 forks source link

[Hivemind] Refactor Github commit extraction functions to object orientated code #93

Closed cyri113 closed 6 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 `GithubCommitExtraction`
- [ ] Migrate `fetch_raw_commits` to a private method `_fetch_raw_commits` in `GithubCommitExtraction`
- [ ] Migrate the `fetch_commits` to a public method `fetch_commits` in `GithubCommitExtraction`
- [ ] Make the class `GithubExtraction` inherit `GithubCommitExtraction`
- [ ] Update the code base to use the `GithubCommitExtraction.fetch_commits` instead of the `fetch_commits`
- [ ] Update the test cases

Note: file coverage should be 100%.