Skip to content
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

Fix: field alias for date_accepted field #114

Merged
merged 4 commits into from
Feb 28, 2024
Merged

Conversation

lwasser
Copy link
Member

@lwasser lwasser commented Feb 28, 2024

Rather than fixing the entire thing i'm working towards cleaning up the parse_issues method. This is a small fix that

  1. adds a field alias to pydantic so there's not a random date field cleanup step in an unexpected place.
  2. adds a small test to ensure the both aliases defined in the model work

i'm guessing there are better ways to setup tests like this but it's a start and i'm trying to keep this contained. this addresses #91 in (a very small) part.

CHANGELOG.md Show resolved Hide resolved
@@ -572,9 +579,6 @@ def get_issue_meta(
"""
issue_meta = {}
for item in body_data[0:end_range]:
# Clean date accepted element
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was just a thing i added in a really random place. it worked but it is so hard to find it if you're working on the code.

@@ -161,7 +161,11 @@ class ReviewModel(BaseModel):
reviewer_2: dict[str, str | None] = {}
archive: Optional[str] = None
version_accepted: Optional[str] = None
date_accepted: Optional[str] = None
date_accepted: Optional[str] = Field(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here i added an alias to allow us to skip the step of cleaning up the field name


# We could setup some example data using fixtures and a conf.py
# Once we have a better view of the test suite.
example = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may end up creating fixtures for some of these things that we can reuse. but for now i just added a variable object to the test so we have a test for aliases

@lwasser
Copy link
Member Author

lwasser commented Feb 28, 2024

oops failing. moving to draft

@lwasser lwasser removed the request for review from willingc February 28, 2024 16:15
@lwasser lwasser marked this pull request as draft February 28, 2024 16:15
Fix: more dtis
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.00%. Comparing base (1c51a92) to head (922333d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   41.64%   44.00%   +2.36%     
==========================================
  Files           4        4              
  Lines         461      459       -2     
  Branches       74       73       -1     
==========================================
+ Hits          192      202      +10     
+ Misses        268      253      -15     
- Partials        1        4       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lwasser lwasser marked this pull request as ready for review February 28, 2024 18:54
@lwasser lwasser merged commit ab0df02 into pyOpenSci:main Feb 28, 2024
4 checks passed
@lwasser lwasser deleted the refactor branch February 28, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant