-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Filtered values not appearing/not working after selected from dropdown Post Migration to Latest Superset Version #29909
Comments
@nicmrayce Hello there! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's work together to solve this issue. To resolve the issue where filters on all dashboards are non-functional after migrating to the latest version of Superset, with selected values appearing as null, you need to ensure that the filter sets are correctly migrated to the new format. The provided migration script Here is the relevant part of the migration script that upgrades the filter sets: def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
dashboards = (
session.query(Dashboard)
.filter(Dashboard.json_metadata.like('%"native_filter_configuration"%'))
.all()
)
changed_filters, changed_filter_sets = 0, 0
for dashboard in dashboards:
try:
json_metadata = json.loads(dashboard.json_metadata)
dashboard.json_metadata = json.dumps(json_metadata, sort_keys=True)
upgrades = upgrade_dashboard(json_metadata)
changed_filters += upgrades[0]
changed_filter_sets += upgrades[1]
dashboard.json_metadata = json.dumps(json_metadata, sort_keys=True)
except Exception:
print(f"Parsing json_metadata for dashboard {dashboard.id} failed.")
raise
session.commit()
session.close()
print(f"Upgraded {changed_filters} filters and {changed_filter_sets} filter sets.") Additionally, you should also run the migration script Here is the relevant part of the script: def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
for dashboard in session.query(Dashboard).all():
if dashboard.json_metadata:
updated = False
try:
json_metadata = json.loads(dashboard.json_metadata)
if filters := json_metadata.get("native_filter_configuration"):
filter_ids = {fltr["id"] for fltr in filters}
for fltr in filters:
for parent_id in fltr.get("cascadeParentIds", [])[:]:
if parent_id not in filter_ids:
fltr["cascadeParentIds"].remove(parent_id)
updated = True
if updated:
dashboard.json_metadata = json.dumps(json_metadata)
except Exception:
logging.exception(
f"Unable to parse JSON metadata for dashboard {dashboard.id}"
)
session.commit()
session.close() Ensure that both migration scripts have been executed successfully. If the problem persists, you may need to manually verify that the |
Any errors in the browser console? |
What do you think, @rusackas ? Do you think our team should implement the suggestions by dosubot or do you think there are other factors causing this? |
I honestly haven't looked into the details of it, but if Dosu's advice is correct and you're willing to open a PR, that sounds great! If there's any opportunity to add tests or simplify code along the way, that's always appreciated :D |
Okay, @rusackas , we have now received a detailed error log as well appearing on our live dashboards: From the error, what does it deduce and could you point us to the right person in Superset that may be able to assist us more based on the error report above? |
@dosu we're using helm chart in Ruby on Rails to install this superset. Does your fix that you propose above apply in this situation? |
Yes, the fix I proposed applies to your situation, even when using Helm Chart in a Ruby on Rails environment. The migration scripts To address the specific error "Cannot load filter. Error: canceling statement due to conflict with recovery DETAIL: User query might have needed to see row versions that must be removed," it seems to be related to PostgreSQL's recovery process. This error typically occurs when a query conflicts with the database's recovery process, such as during a backup or replication. Here are the steps you should follow:
By following these steps, you should be able to resolve the filter functionality issues and address the PostgreSQL conflict error. If the problem persists, you may need to further investigate the specific queries causing the conflict and optimize them accordingly. |
Sorry this isn't helpful, but changing the title a little bit from "SS" since (a) it's Superset rather than Super Set, and (b) SS has negative historical connotations (I do not mean Chevy SuperSport models) |
Bug description
I'm having an issue after migrating our older Superset to the latest version 4.0.2.
The issue is that all dashboards that we've migrated from older Superset have filters non-functional. Not only the values appear null after selected (the values however, appear in dropdown), the filter no longer works too.
I even attempted to recreate the filters from scratch again but to no avail. Requiring some assistance/hints to solve the following matter. Your response is much appreciated.
How to reproduce the bug
Screenshots/recordings
Bug #1:
Bug #2:
Previous Superset version
1.5.2
Current Superset version
4.0.2
master / latest-dev
Browser
Chrome
Additional context
No response
Stack Trace
Not applicable since we're using Helm Chart Package Manager to install Superset
Checklist
The text was updated successfully, but these errors were encountered: