mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: Show full long number in text email report for table chart. (#19575)
* fix lint issue * resolve comment * fix pipeline broken issue * resolve pipeline broken issue
This commit is contained in:
@@ -90,11 +90,16 @@ def get_chart_csv_data(
|
||||
def get_chart_dataframe(
|
||||
chart_url: str, auth_cookies: Optional[Dict[str, str]] = None
|
||||
) -> Optional[pd.DataFrame]:
|
||||
# Disable all the unnecessary-lambda violations in this function
|
||||
# pylint: disable=unnecessary-lambda
|
||||
content = get_chart_csv_data(chart_url, auth_cookies)
|
||||
if content is None:
|
||||
return None
|
||||
|
||||
result = simplejson.loads(content.decode("utf-8"))
|
||||
|
||||
# need to convert float value to string to show full long number
|
||||
pd.set_option("display.float_format", lambda x: str(x))
|
||||
df = pd.DataFrame.from_dict(result["result"][0]["data"])
|
||||
|
||||
# rebuild hierarchical columns and index
|
||||
|
||||
Reference in New Issue
Block a user