Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The metric label cannot match the name of the field #21658

Open
3 tasks done
zertyuiop opened this issue Sep 29, 2022 · 7 comments
Open
3 tasks done

The metric label cannot match the name of the field #21658

zertyuiop opened this issue Sep 29, 2022 · 7 comments
Labels
#bug Bug report data:connect:googlebigquery Related to BigQuery

Comments

@zertyuiop
Copy link

zertyuiop commented Sep 29, 2022

The metric label cannot match the name of the field used in the metric (for metrics created using the graph editor, if this field is subsequently used for filtering with the aggregation function (for the BigQuery engine, it gives an error 400 Aggregations of aggregations are not allowed)).

How to reproduce the bug

  1. Create table chart with metric SUM(visits) (for example)
  2. Filter it with metric SUM(visits)>100
  3. Try to remame label of SUM(visits) to Visits (or visits)
  4. See error 400 Aggregations of aggregations are not allowed (for BigQuery)

Expected results

Metric labels (and, accordingly, for example, the names of columns in a table chart) must have any form (they can match the names of the table fields, be written in non-English language).

Actual results

Metric labels are used in SQL statements that return a table for plotting. However, many database engines have restrictions on the use of non-English field names or other similar issues that lead to bugs.

Environment

(please complete the following information):

  • browser type and version: Any
  • superset version: 2.0.0, 0dda5fe

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Metric labels should be stored separately and not used in SQL statements (neutral labels of the "label_1f" type should be used there, and metric labels (and the metrics themselves) should already be attached to these labels in order to eliminate compatibility problems with various database engines as much as possible). Connected issue: #16108

@zertyuiop zertyuiop added the #bug Bug report label Sep 29, 2022
@zertyuiop
Copy link
Author

Same issue: #3136

@ShaliniIruvuru
Copy link

Working as Expected.
Loom video:-
https://www.loom.com/share/dc845f75a6054bd9874d9c8f8d5f29ab

@zertyuiop
Copy link
Author

@ShaliniIruvuru this issue is specific to Google BigQuery and possibly some other DBMS. You just gave an example that this issue is not relevant for PostgreSQL, but it is still relevant for BigQuery.

@rusackas
Copy link
Member

@zertyuiop is this still an issue in Superset 3.x?

@zertyuiop
Copy link
Author

@rusackas the issue is still partially valid. While giving a metric the same name as a column is no longer an issue, using non-ASCII characters in labels remains (#16108).

@zertyuiop
Copy link
Author

zertyuiop commented Feb 24, 2024

#26461 could be a valid solution for BigQuery, tested on the current dev version. But I cannot check whether this problem occurs in other DBMSs. Thus, additional context in describing the issue is still relevant.

@rusackas rusackas added the data:connect:googlebigquery Related to BigQuery label Jun 12, 2024
@rusackas
Copy link
Member

@zertyuiop can you confirm if this is effectively solved for BigQuery in current versions? I'm not sure whether or not other DBs are affected, but since this was reported regarding BigQuery, I'm inclined to close the issue as resolved, and let people open new issues if it turns up elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report data:connect:googlebigquery Related to BigQuery
Projects
None yet
Development

No branches or pull requests

3 participants