Skip to content

Conversation

@eschutho
Copy link
Member

@eschutho eschutho commented Aug 8, 2024

SUMMARY

Aiming to have the mutator run on every analytical db request, I'm adding it to the get_columns_description which is used when creating a virtual dataset and looking up which columns should be added to the dataset.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

update the SQL_QUERY_MUTATOR. As a test, I edited mine to look like this:

def mutator(sql: str, database: Any, **kwargs: Any) -> str:

    key = "foo"
    output = f"-- {key}\n"

    return output + f"select color from bart_lines\n-- {key}"


SQL_QUERY_MUTATOR = mutator

with the mutator:
Screenshot 2024-08-08 at 3 35 18 PM
Screenshot 2024-08-08 at 3 35 12 PM

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added data Namespace | Anything related to data, including databases configurations, datasets, etc. data:dataset Related to dataset configurations labels Aug 8, 2024
@eschutho eschutho marked this pull request as draft August 8, 2024 00:49
@eschutho eschutho force-pushed the elizabeth/add-mutator-dataset branch from 7734db3 to 06bdca7 Compare August 8, 2024 22:34
@pull-request-size pull-request-size bot added size/L and removed size/XS labels Aug 8, 2024
@eschutho eschutho marked this pull request as ready for review August 8, 2024 22:34
@dosubot dosubot bot added the change:backend Requires changing the backend label Aug 8, 2024


@contextmanager
def create_and_cleanup_table(table=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@eschutho eschutho merged commit 38d64e8 into master Aug 9, 2024
@rusackas rusackas deleted the elizabeth/add-mutator-dataset branch August 9, 2024 20:36
@sadpandajoe sadpandajoe added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Dec 4, 2024
sadpandajoe pushed a commit that referenced this pull request Dec 4, 2024
nyohasstium pushed a commit to Webgains/superset that referenced this pull request Jan 2, 2025
@github-actions github-actions bot added 🍒 4.1.2 Cherry-picked to 4.1.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 24, 2025
@mistercrunch mistercrunch added the 🍒 4.1.3 Cherry-picked to 4.1.3 label Jul 29, 2025
@mistercrunch mistercrunch added the 🚢 5.0.0 First shipped in 5.0.0 label Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:backend Requires changing the backend data:dataset Related to dataset configurations data Namespace | Anything related to data, including databases configurations, datasets, etc. preset-io size/L v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch 🍒 4.1.2 Cherry-picked to 4.1.2 🍒 4.1.3 Cherry-picked to 4.1.3 🍒 4.1.4 🚢 5.0.0 First shipped in 5.0.0

Projects

No open projects
Status: Cherried

Development

Successfully merging this pull request may close these issues.

5 participants