TogetherCrew / airflow-dags

1 stars 1 forks source link

[Hivemind] Refactor Github issue extraction functions to object orientated code #98

Open cyri113 opened 5 months ago

cyri113 commented 5 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
- [x] Create a class `GithubIssueExtraction`
- [x] Migrate `fetch_raw_issues` to a private method `_fetch_raw_issues` in `GithubIssueExtraction`
- [x] Migrate the `fetch_issues` to a public method `fetch_issues` in `GithubIssueExtraction`
- [x] Make the class `GithubExtraction` inherit `GithubIssueExtraction`
- [x] Update the code base to use the `GithubIssueExtraction.fetch_issues` instead of the `fetch_issues`
- [x] Update the test cases

Note: file coverage should be 100%.

JacobCWBillings commented 5 months ago

Code pushed passed all checks