superset icon indicating copy to clipboard operation
superset copied to clipboard

Cross-filter throws error "Cannot compile Column object until its 'name' is assigned."

Open wellykachtel opened this issue 2 years ago • 5 comments

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

  1. 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_date as the dimension and count(distinct user_id) as the metric
  2. 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_date and user_id
  3. Enable DASHBOARD_CROSS_FILTERS feature flag
  4. Enable cross filtering in the dashboard
  5. 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) image

"See more" image

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.

wellykachtel avatar Jul 12 '23 21:07 wellykachtel

Hey wellykachtel, can you share what database you are currently using?

kikobarr avatar Jul 21 '23 17:07 kikobarr

@kikobarr Redshift

wellykachtel avatar Jul 25 '23 15:07 wellykachtel

@wellykachtel what version of the driver are you on?

eschutho avatar Aug 24 '23 23:08 eschutho

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.

cmcnicoll avatar Nov 09 '23 02:11 cmcnicoll

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

robson83 avatar Feb 09 '24 16:02 robson83

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.

rusackas avatar Jun 03 '24 18:06 rusackas