8000 New Dashboard Chart throws TypeError: format requires a mapping · Issue #21250 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New Dashboard Chart throws TypeError: format requires a mapping #21250
Closed
@101v

Description

@101v

Description of the issue

I have created an elementary, stripped-down report to demonstrate the problem. It has one filter called "period" of type "Select" and has three options, as shown below:

Period (filter field)

01

The report doc:

02

When I run the report using the "Show Report" button and select one of the filter options, it simply lists that option, as shown below.

03

The next step is to create a chart out of this report. I open the New Dashboard Chart screen, specify Chart Name, change Chart Type to Report and select "Test Report" from the "Report Name" list.

04

Observed result

As soon as I select the report name in the dropdown, It shows the following error:

05

Expected result

I should be able to select fields in the X-field and Y-axis as well as Filters should be populated.

Stacktrace / full error message

App Versions

{
"erpnext": "14.25.1",
"frappe": "14.36.3",
"payments": "0.0.1"
}

Route

Form/Dashboard Chart/new-dashboard-chart-3

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1607, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/__init__.py", line 789, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "apps/frappe/frappe/desk/query_report.py", line 231, in run
    result = generate_report_result(report, filters, user, custom_columns, is_tree, parent_field)
  File "apps/frappe/frappe/__init__.py", line 789, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "apps/frappe/frappe/desk/query_report.py", line 90, in generate_report_result
    res = get_report_result(report, filters) or []
  File "apps/frappe/frappe/desk/query_report.py", line 68, in get_report_result
    res = report.execute_query_report(filters)
  File "apps/frappe/frappe/core/doctype/report/report.py", line 117, in execute_query_report
    result = [list(t) for t in frappe.db.sql(self.query, filters)]
  File "apps/frappe/frappe/database/database.py", line 219, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 156, in execute
    query = self.mogrify(query, args)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 134, in mogrify
    query = query % self._escape_args(args, conn)
TypeError: format requires a mapping

Request Data

{
"type": "POST",
"args": {
"report_name": "Sales Profitability",
"filters": null,
"ignore_prepared_report": 1
},
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.query_report.run"
}

Response Data

{
"exception": "TypeError: format requires a mapping"
}

Additional information

Hosted on Frappe Cloud

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0