refactor(treewide): formatting and ruff fixes, + manually enabled F401
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from typing import Any, Dict, NewType, Optional
|
||||
from typing import Any, NewType
|
||||
|
||||
import frappe
|
||||
from frappe.core.doctype.report.report import get_report_module_dotted_path
|
||||
|
||||
ReportFilters = Dict[str, Any]
|
||||
ReportFilters = dict[str, Any]
|
||||
ReportName = NewType("ReportName", str)
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ def execute_script_report(
|
||||
report_name: ReportName,
|
||||
module: str,
|
||||
filters: ReportFilters,
|
||||
default_filters: Optional[ReportFilters] = None,
|
||||
optional_filters: Optional[ReportFilters] = None,
|
||||
default_filters: ReportFilters | None = None,
|
||||
optional_filters: ReportFilters | None = None,
|
||||
):
|
||||
"""Util for testing execution of a report with specified filters.
|
||||
|
||||
@@ -77,9 +77,7 @@ def execute_script_report(
|
||||
default_filters = {}
|
||||
|
||||
test_filters = []
|
||||
report_execute_fn = frappe.get_attr(
|
||||
get_report_module_dotted_path(module, report_name) + ".execute"
|
||||
)
|
||||
report_execute_fn = frappe.get_attr(get_report_module_dotted_path(module, report_name) + ".execute")
|
||||
report_filters = frappe._dict(default_filters).copy().update(filters)
|
||||
|
||||
test_filters.append(report_filters)
|
||||
|
||||
Reference in New Issue
Block a user