Cross-filter throws error "Cannot compile Column object until its 'name' is assigned."
A clear and concise description of what the bug is. When attempting to use a cross-filter to filter table B by clicking a row in table A, table B throws error "DB engine Error". When clicking "See more", the full error reads:
Cannot compile Column object until its 'name' is assigned.
This may be triggered by: Issue 1011 - Superset encountered an unexpected error.
How to reproduce the bug
- Create Chart A in Dashboard: Using a dataset that is a large table with a user_id and create_date, create a table chart that has
create_dateas the dimension and count(distinct user_id) as the metric - Create Chart B in Dashboard: Using a dataset that is a large table with a user_id and create_date, create a table chart that is just the raw values of this dataset, columns
create_dateanduser_id - Enable
DASHBOARD_CROSS_FILTERSfeature flag - Enable cross filtering in the dashboard
- While in dashboard view, click a single row in chart A
Expected results
Chart B should be filtered by the create_date that was selected in Chart A. E.g. all users in the date selected will be present in Chart B
Actual results
Error (Chart B)
"See more"
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
(please complete the following information):
- browser type and version: Firefox 115.0.2
- superset version:
2.1.0 - any feature flags active:
FEATURE_FLAGS = { 'GLOBAL_ASYNC_QUERIES': False, 'SQLLAB_BACKEND_PERSISTENCE': True,
'VERSIONED_EXPORT': True, 'ENABLE_TEMPLATE_PROCESSING': True,
'DASHBOARD_RBAC': True, 'DRILL_TO_DETAIL': True,
'DRILL_BY': True, 'DASHBOARD_CROSS_FILTERS': True}
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Add any other context about the problem here.
Hey wellykachtel, can you share what database you are currently using?
@kikobarr Redshift
@wellykachtel what version of the driver are you on?
I'm getting the same error on Redshift for apache/superset:3.0.1 with psycopg2==2.9.9 and sqlalchemy-redshift==0.8.14.
I have a Table and a Pivot Table that reference the same dataset with one DATE column: batch_date. The Table is set to RAW RECORDS. And the Pivot Table uses the batch_date in group by ROWS with APPLY METRICS ON = COLUMNS.
When I click on a batch_date value in the Table, the error is displayed in the Pivot Table. When I click on a batch_date value in the Pivot Table, the error is displayed in the Table.
It seems like the Pivot Table is treating the batch_date as a TIMESTAMP because the TIME GRAIN can be set to Second.
I'm facing exactly the same problem, but using DuckDB. I saw a related bug that was fixed on snowflake:
https://github.com/apache/superset/compare/fix/d2d-cannot-compile-column
I don't have RedShift, but I do have MotherDuck. Anyone got a sample (generated?) dataset? Can you confirm the issue is happening on MotherDuck in addition to vanilla DuckDB? Can you confirm it's not a problem on more common DBs (postres, MySQL, etc)? Trying to understand if this is a database driver problem or a Superset-wide bug. It's at risk of being stale, so we need more context if we're to keep it open.