Removed the "be" cast function to cast data type for the binary expressions. It is to be replaced by the mapped type hints.

This commit is contained in:
2023-04-23 10:35:50 +08:00
parent 09dd5ae541
commit eed4c923f6
9 changed files with 26 additions and 52 deletions

View File

@ -32,7 +32,6 @@ from accounting.report.utils.base_report import BaseReport
from accounting.report.utils.csv_export import csv_download
from accounting.report.utils.report_chooser import ReportChooser
from accounting.report.utils.report_type import ReportType
from accounting.utils.cast import be
from accounting.utils.pagination import Pagination
from accounting.utils.query import parse_query_keywords
from .journal import get_csv_rows
@ -128,9 +127,8 @@ class LineItemCollector:
journal_entry_date: datetime
try:
journal_entry_date = datetime.strptime(k, "%Y")
conditions.append(
be(sa.extract("year", JournalEntry.date)
== journal_entry_date.year))
conditions.append(sa.extract("year", JournalEntry.date)
== journal_entry_date.year)
except ValueError:
pass
try: