Skip to content

Commit

Permalink
chore: Rename function to avoid ambiguity. docs: Delete docstring to …
Browse files Browse the repository at this point in the history
…avoid having to update it every time a statistic is added/removed.
  • Loading branch information
jpmckinney committed Oct 11, 2024
1 parent a336d12 commit e60e852
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def list_commands(self, ctx: click.Context) -> list[str]:


# Called by fetch-award* commands.
def _create_complete_application(session: Session, award_entry: dict[str, str]) -> None:
def _create_application(session: Session, award_entry: dict[str, str]) -> None:
with handle_skipped_award(session, "Error creating application"):
# Create the award. If it exists, skip this award.
award = util.create_award_from_data_source(session, award_entry)
Expand Down Expand Up @@ -133,7 +133,7 @@ def fetch_awards(
"Source contract is missing required fields:"
f" url={awards_response.url}, data={awards_response_json}"
)
_create_complete_application(session, entry)
_create_application(session, entry)

index += 1
awards_response = data_access.get_new_awards(index, from_date, until_date)
Expand All @@ -156,7 +156,7 @@ def fetch_award_by_id_and_supplier(award_id: str, supplier_id: str) -> None:
return

with contextmanager(get_db)() as session:
_create_complete_application(session, award_response_json[0])
_create_application(session, award_response_json[0])


@app.command()
Expand Down
2 changes: 1 addition & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ class ApplicationBase(SQLModel):
#: .. seealso:: :meth:`app.models.Application.days_waiting_for_lender`
completed_in_days: int | None

#: The time at which the application was most recently overdue (reset once completed).
#: The time at which the application was most recently overdue (reset once approved).
#:
#: .. seealso:: :attr:`~app.settings.Settings.progress_to_remind_started_applications`
overdued_at: datetime | None = Field(sa_column=Column(DateTime(timezone=True)))
Expand Down
4 changes: 1 addition & 3 deletions app/utils/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ def get_general_statistics(
Get general statistics about applications based on the provided parameters.
This function retrieves general statistics about applications based on the provided start_date, end_date, and
lender_id (if available). The statistics include the count of applications received, approved, rejected, waiting
for information, in progress, average amount requested, average repayment period, count of overdue applications,
average processing time, and proportion of submitted applications out of the opt-in applications.
lender_id (if available).
:param start_date: The start date for filtering applications. (default: None)
:param end_date: The end date for filtering applications. (default: None)
Expand Down

0 comments on commit e60e852

Please sign in to comment.