Since upgrading from Superset 2.0.1 to 3.0.2, creating new charts or editing existing charts with annotations layers results in them not being rendered. Already existing charts still render annotations layers in dashboard.

How to reproduce the bug

  1. Create a new chart, e.g. Line Chart
  2. Define any metric so something is rendered
  3. Create an Annotation Layer of type Formula

Expected results

Annotation actually gets rendered

Actual results

Annotation doesn't get rendered

Screenshots

Apache Superset [BUG] Annotation Layers of type Formula aren't rendered for new charts Apache Superset [BUG] Annotation Layers of type Formula aren't rendered for new charts

Environment

(please complete the following information):

  • browser type and version: Firefox 120.0.1 (64-bit)
  • superset version: 3.0.2-py310 (official docker image deployed on K8s

Feature flags:

'DASHBOARD_CROSS_FILTERS': True,
'DASHBOARD_RBAC': True,
'DASHBOARD_VIRTUALIZATION': True,
'DRILL_BY': True,
'DRUID_JOINS': True,
'ENABLE_TEMPLATE_PROCESSING': True,
'HORIZONTAL_FILTER_BAR': True,

Comment From: matheusbsilva

I'm facing the same issue here on Superset 3.0.0: Apache Superset [BUG] Annotation Layers of type Formula aren't rendered for new charts

Comment From: garrett-franklin30

I'm also experiencing this issue, Superset 3.1.1. For what it's worth, I have the following overlap in feature flags with @D3nn3: "DASHBOARD_RBAC": True, "ENABLE_TEMPLATE_PROCESSING": True, "HORIZONTAL_FILTER_BAR": True

Comment From: garrett-franklin30

@D3nn3, @matheusbsilva I did some digging, and I did discover a workaround - hoping to solve the root cause at some point when I get some more time.

I got my local environment hooked up to my production database for debugging, and found that when I tried an annotation layer on a different dataset, it worked. I still however couldn't get the annotation to show up on the original dataset I was testing with. I then had the idea to duplicate the original dataset and try on the duplicate, and sure enough the annotation showed up.

So as a workaround, I can create a duplicate dataset and switch my existing charts to the new dataset, and that seems to do the trick for now.

Hope this works for other people experiencing the issue, would love to hear if it does!

EDIT: I should clarify that when I say "duplicate", I mean create a new dataset with the same SQL - using the duplicate feature led to the same issue as before.

Comment From: D3nn3

I had some time to try out your findings @garrett-franklin30 and I could replicate them.

  • Took a dataset where annotation layers are bugged
  • Duplicated the dataset with the provides Superset feature -> no success
  • Created a new dataset with the same query -> success

While trying to figure out what the problem was, a colleague and I also find out that it seems to sometimes work and sometimes not. Could be that the reason were different datasets, so this bug might be dataset dependent.

Comment From: brantian

+1 on this bug, in version 4.0.2

I can confirm that changing the dataset seems to make the annotations show as expected, however, the mentioned duplication workaround doesn't work for my use case as we're dealing with multiple deployments/reports, so the workaround doesn't scale

Comment From: zhang-jc

Please check if the time series has been set. I also encountered the same problem, but after setting the time series field, it can be displayed normally. TravelDate

Annotation

Comment From: brantian

In my case, the time series has been set and its column marked as temporal, but the error still persists

Comment From: shengbinxu

Please check if the time series has been set. I also encountered the same problem, but after setting the time series field, it can be displayed normally.请检查时间序列是否已设置。我也遇到了同样的问题,但是设置了时间序列字段后,就可以正常显示了。

请问,你是什么版本? 我用的4.0.2,还是不行,注释层无论如何都不展示

Comment From: zhang-jc

Please check if the time series has been set. I also encountered the same problem, but after setting the time series field, it can be displayed normally.请检查时间序列是否已设置。我也遇到了同样的问题,但是设置了时间序列字段后,就可以正常显示了。

请问,你是什么版本? 我用的4.0.2,还是不行,注释层无论如何都不展示 我用的也是4.0.2版本

Comment From: shengbinxu

Please check if the time series has been set. I also encountered the same problem, but after setting the time series field, it can be displayed normally.请检查时间序列是否已设置。我也遇到了同样的问题,但是设置了时间序列字段后,就可以正常显示了。

请问,你是什么版本? 我用的4.0.2,还是不行,注释层无论如何都不展示 我用的也是4.0.2版本

现在可以了。

我前面配置错误了,添加了注释层(Annotation Layer)之后,没有进一步添加注释(annotation),现在正常了。 Apache Superset [BUG] Annotation Layers of type Formula aren't rendered for new charts Apache Superset [BUG] Annotation Layers of type Formula aren't rendered for new charts

Comment From: rusackas

Hi folks... is this still perceived as a Superset bug? It's been dormant for >6 months (perhaps due to language, or other complications... maybe it's just an edge case?) but it's at risk of being closed as stale. If anyone can validate it as a bug in current versions (4.1.2 or newer) that'd be appreciated.

Comment From: rusackas

Closing as inactive / not prioritized, but happy to reopen/revisit, or accept a new issue with updated context. Thanks!