Comments (4)
Hmm... I don't really use the text-based reports, so I'll CC @yousoph here for more context/info. Did they ever support these formatters, or is it just the raw data from the database? The date formatters are picked up by the various visualizations to use as they need to... if we need to add support for formatters in text-based reports where it didn't exist before, then that seems more like a new feature request.
from superset.
Hmm... I don't really use the text-based reports, so I'll CC @yousoph here for more context/info. Did they ever support these formatters, or is it just the raw data from the database? The date formatters are picked up by the various visualizations to use as they need to... if we need to add support for formatters in text-based reports where it didn't exist before, then that seems more like a new feature request.
Yes, the data is retrieved from the database, and some formats have been implemented while others haven't. Here's a summary of my findings:
,d (12345.432 => 12,345) NG
.1s (12345.432 => 10k) NG
.3s (12345.432 => 12.3k) NG
,.1% (12345.432 => 1,234,543.2%) OK
.2% (12345.432 => 1234543.20%) OK
.3% (12345.432 => 1234543.200%) OK
.4r (12345.432 => 12350) NG
,.1f (12345.432 => 12,345.4) OK
,.2f (12345.432 => 12,345.43) OK
,.3f (12345.432 => 12,345.432) OK
"+, (12345.432 => +12,345) " NG
$,.2f (12345.432 => $12,345.43) NG
Duration in ms (66000 => 1m 6s) NG
Duration in ms (1.40008 => 1ms 400ยตs 80ns) NG
%d/%m/%Y | 14/01/2019 NG
%m/%d/%Y | 01/14/2019 NG
%Y-%m-%d | 2019-01-14 NG
%Y-%m-%d %H:%M:%S | 2019-01-14 01:32:10 OK
%d-%m-%Y %H:%M:%S | 14-01-2019 01:32:10 NG
%H:%M:%S | 01:32:10 NG
Prefix ยฅ (JPY) NG
Suffix ยฅ (JPY) NG
from superset.
Oh, interesting... I didn't know it was a mixed bag... I'm not sure why some are being picked up, but not others.
CC @eschutho in case you happen to know which gear isn't meshing.
from superset.
Below is a section of Python backend formatting code (found within the 'post_processing.py' file). It is deemed accurate if the Python format method aligns exactly with the d3format syntax, for instance, when using .1%.
def table(
df: pd.DataFrame,
form_data: dict[str, Any],
datasource: Optional[ # pylint: disable=unused-argument
Union["BaseDatasource", "Query"]
] = None,
) -> pd.DataFrame:
"""
Table.
"""
# apply `d3NumberFormat` to columns, if present
column_config = form_data.get("column_config", {})
for column, config in column_config.items():
if "d3NumberFormat" in config:
format_ = "{:" + config["d3NumberFormat"] + "}"
try:
df[column] = df[column].apply(format_.format)
except Exception: # pylint: disable=broad-except
# if we can't format the column for any reason, send as is
pass
return df
from superset.
Related Issues (20)
- CVE-2023-46104 and CVE-2024-23952 - duplicate reports
- shillelagh error: 'str' object has no attribute 'items' in superset HOT 1
- Error warming up cache: Error 302 HOT 4
- ๐ Assigning roles to users lead to integrity error message HOT 4
- Error on embedded dashboard after upgrading to 3.1.1: "Guest user cannot modify chart payload" HOT 44
- Update dependencies in superset-frontend package.json HOT 1
- SDK for Embedding dashboards
- [SIP] Ability to assign a unique asset id to a superset dashboard / visual
- Inter font chosen in Table does not allow correct alignment of dates and numbers
- Superset 2.x: `AttributeError: module 'flask.json' has no attribute 'JSONEncoder'`
- Dashboard Filter Side HOT 1
- frontend-check build failures for branches HOT 1
- report exception (email-chart-text)
- Bulk delete charts pagination disappeared
- superset 2.1.0 frontend start to use the "npm run dev-server", will appear many warnings HOT 1
- custom SQL aliases in raw records are not being used as column labels in chart HOT 1
- Radar Chart label color accessibility HOT 2
- Official Steps Keep Failing for Docker-compose on ARM Mac
- error loading the tables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.