-
Notifications
You must be signed in to change notification settings - Fork 15.1k
feat: DB migration for dataset folders #32680
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Fix Detected |
---|---|---|
Misleading migration name ▹ view | ||
Denormalized Database Design Using JSON Column ▹ view | ||
Migration description missing column details ▹ view | ||
Missing JSON default value ▹ view |
Files scanned
File Path | Reviewed |
---|---|
superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folder_table.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Documentation ✅ Logging ✅ Error Handling ✅ Readability ✅ Design ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
"""Add folder table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading migration name 
Tell me more
What is the issue?
The migration name is misleading as it adds a column to an existing table rather than creating a new table.
Why this matters
This could cause confusion during code maintenance and make it harder to track schema changes accurately.
Suggested change ∙ Feature Preview
Change the migration name to accurately reflect the change:
"""Add folders column to tables table"""
💬 Looking for more details? Reply to this comment to chat with Korbit.
superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folder_table.py
Outdated
Show resolved
Hide resolved
"""Add folder table | ||
|
||
Revision ID: 94e7a3499973 | ||
Revises: 74ad1125881c | ||
Create Date: 2025-03-03 20:52:24.585143 | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migration description missing column details 
Tell me more
What is the issue?
The migration docstring lacks information about the purpose and structure of the new 'folders' column being added.
Why this matters
Future developers will not understand the intended use of the JSON column or its schema, making it harder to maintain or debug issues.
Suggested change ∙ Feature Preview
"""Add folder table
Revision ID: 94e7a3499973
Revises: 74ad1125881c
Create Date: 2025-03-03 20:52:24.585143
Adds a JSON column 'folders' to the tables table to store folder hierarchy and metadata
for organizing tables. The column is nullable to maintain backward compatibility.
"""
💬 Looking for more details? Reply to this comment to chat with Korbit.
superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folder_table.py
Outdated
Show resolved
Hide resolved
898ccc4
to
3053921
Compare
def upgrade(): | ||
op.add_column( | ||
"tables", | ||
sa.Column("folders", JSON, nullable=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sadpandajoe mentioned that there's a utility for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find one in superset/migrations/utils
. 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's kinda buried towards the bottom: https://github.com/apache/superset/blob/master/superset/migrations/shared/utils.py#L294
(cherry picked from commit b64e325)
SUMMARY
DB migration for #32520, separated to make it easy to cherry-pick.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION