-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
4.0 - Imported charts shows error on embedding #28446
Comments
To address the issue of "Guest user cannot modify chart payload" for imported charts in Apache Superset 4.0.0, you can automate the update of the
Before proceeding with either method, ensure you have a complete backup of your database to prevent data loss. It's also recommended to test your solution in a development environment before applying it to production. Here's a simplified example of how you might use Python to update chart metadata using Superset's API: import requests
SUPSERET_API_URL = "http://your-superset-instance/api/v1/chart"
API_TOKEN = "your_api_token"
def update_chart(chart_id, updated_config):
headers = {"Authorization": f"Bearer {API_TOKEN}"}
response = requests.put(f"{SUPSERET_API_URL}/{chart_id}", json=updated_config, headers=headers)
if response.status_code == 200:
print(f"Successfully updated chart {chart_id}")
else:
print(f"Failed to update chart {chart_id}: {response.text}")
# Example usage
chart_id = 123 # Example chart ID
updated_config = {
# Your updated chart configuration including the new query_context
}
update_chart(chart_id, updated_config) This script is a basic example and will need to be adjusted based on your specific requirements, including authentication and the exact structure of the
|
I actually tried to call the update api to see if the |
I also noticed a different related issue. |
I could patch the issue described (「Guest user cannot modify chart payload」): |
@betodealmeida am I taking crazy pills or does this sound like the issue you fixed in unblocking 4.0? |
I think the issue blocking 4.0 previously was without imports, embeds would show that error for certain charts. This is a blocker for us though, as we use a multi-environment setup and have to use imports to deploy to higher environments. Adding a new manual step to an already cumbersome pipeline wouldn't bode well. |
Any update on this? We use a multi-environment set up and this presently a blocker. |
We're also experiencing this issue and have not updated to 4.x.x because of this. Was working fine on 3.x. There are some nice improvements within 4.x we'd like to take advantage of, but this is currenty blocking us from updating. |
@michael-s-molina do you have any context on this, perchance? |
@rusackas I think this was caused by a change made by @betodealmeida #27484 |
From my understanding of the problem:
So a fix could be around properly export the charts in the first place and stop removing the query_context when importing. A temporary workaround is to update the charts using the api, based on the exported query_context. Of course if you are exporting and importing on a different instance, you need to change ids references in the query_context |
Any news on this ? I have the same problem in 3.1.1 |
Nope, no news yet. Anyone here is welcome to explore a fix... I'm guessing @betodealmeida is just a bit too busy to get to it right now. |
Sorry, I missed this. Let me take a look, seems like we need to fix the import/export. |
Hey @betodealmeida, and updates on this by chance? |
cannot upgrade to 4.0.2 because of this issue. we are still using 3.0.2. we are using multi-environment set up and saving each charts in each instance isn't practical. any turnaround for this issue? |
Bug description
「Guest user cannot modify chart payload」 Error is displayed for imported charts.
It's related to this issue, but with a specific reproduction flow. (#27177)
How to reproduce the bug
Screenshots/recordings
Superset version
4.0.0
Python version
3.9
Node version
16
Browser
Chrome
Additional context
It seems that the export/import functionality doesn't copy the
query_context
field. (It becomesnull
after import)I believe the
query_context
became important after this PR: https://github.com/apache/superset/pull/27484/filesWorkaround
I noticed that just by opening the imported chart in the superset side updates the
query_context
and the embed starts working for that chart. We can't use this workaround as we have hundreds of charts for each of our clients.Checklist
The text was updated successfully, but these errors were encountered: