Comments (1)
Hey there, @fgvieira! I'm here to assist you with any bugs, questions, or contributions you might have for the repository. Let me know how I can help you!
To resolve the warnings encountered when running superset db upgrade
after installing Superset using conda, you can follow the steps outlined in the migration script provided. The script ensures that any duplicates are removed and a unique constraint is created on the tagged_object
table.
Here is the relevant code from the migration script:
def upgrade():
bind = op.get_bind() # Get the database connection bind
# Reflect the current database state to get existing tables
metadata.reflect(bind=bind)
# Delete duplicates if any
min_id_subquery = (
select(
[
func.min(tagged_object_table.c.id).label("min_id"),
tagged_object_table.c.tag_id,
tagged_object_table.c.object_id,
tagged_object_table.c.object_type,
]
)
.group_by(
tagged_object_table.c.tag_id,
tagged_object_table.c.object_id,
tagged_object_table.c.object_type,
)
.alias("min_ids")
)
delete_query = tagged_object_table.delete().where(
tagged_object_table.c.id.notin_(select([min_id_subquery.c.min_id]))
)
bind.execute(delete_query)
# Create unique constraint
utils.create_unique_constraint(op, index_id, table_name, uix_columns)
This script performs the following actions:
- Reflects the current database state to get existing tables.
- Deletes any duplicate entries in the
tagged_object
table. - Creates a unique constraint on the
tagged_object
table to prevent future duplicates.
Ensure that you have the migration_utils
module available and properly configured, as it is used to create and drop the unique constraint.
Additionally, after running the migration script, you should follow the standard procedure for upgrading Superset's metadata database:
superset db upgrade
superset init
While upgrading Superset should not delete your charts and dashboards, it is recommended to backup your metadata database before upgrading. For production environments, consider upgrading in a staging environment first and then upgrading production during off-peak hours.
Refer to the UPDATING.md
file for any potential downtime or breaking changes that might affect your deployment. For example, adding an index to query.sql_editor_id
or updating database columns to use the MediumText
type might require some downtime on large deployments. Always review the latest updates and changes to ensure a smooth upgrade process [1][2][3].
To continue talking to Dosu, mention @dosu.
from superset.
Related Issues (20)
- Failed to setup alerts and reports based pypi installation HOT 6
- 4.0.1: Alerting and reports does not take EMAIL RECIPIENTS* HOT 4
- Filter does not follow label HOT 1
- [SIP-138] Proposal for Slack file upload V2 integration for Alerts and Reports HOT 3
- [SIP-139] Proposal for Ant Design 5.x Upgrade HOT 4
- On KILL QUERY error "expected string or bytes-like object" in Clickhouse DB HOT 1
- build fails when using docker compose up HOT 7
- Blank Charts while loading dashboard HOT 2
- 500 error and unexpected keyword argument 'extra_filters' HOT 3
- sqlalchemy.exc.ArgumentError HOT 1
- Oracle as Metadata- Not working HOT 2
- Thumbnails work for Dashboards, not for charts HOT 1
- Unable to set role permissions for new schema unless a new connection is created. HOT 1
- Superset Login Redirect After Guest Token Usage in Angular Iframe HOT 1
- start of production no possible due to errors in docker-compose-non-dev.yml and docker/.env HOT 3
- Data Misalignment When Applying Filter HOT 5
- PLAYWRIGHT_REPORTS_AND_THUMBNAILS grey output for dashboards HOT 4
- Superset 3.1.3: Long Dashboards render blank thumbnails unless Dashboard length is reduced HOT 4
- Changing to non-temporal variable, then back, causes time grain to no longer function in 4.0.2rc2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.