Skip to content
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

Hcheng/add slice to mutator #1

Merged
merged 2 commits into from
Sep 5, 2023
Merged

Conversation

hwmarkcheng
Copy link
Owner

@hwmarkcheng hwmarkcheng commented Aug 23, 2023

SUMMARY

Hi team,

We're looking to make a few changes that would allow folks to populate the sql_query_mutator with more useful params. We're open to discussion on the best practices to do so.

These are the three items we're looking to change:

  • Change mutate_query_from_config to take in kwargs (Consistent with intended purpose of sql_query_mutator, see this PR)
  • Add slice_id to query_obj : As addition context for query_obj. Having slice_id is versatile and can open doors for powerful integrations/automations. We originally wanted to add in the whole slice object for more options, but some integration tests failed since the object cannot be converted to a dictionary. Happy to discuss the best way to do this going forward.
  • Add chart_id and dataset_id as default parameters for mutate_query_from_config

Example Usecase, Automated Data Access Requests via Satori:
Context: We use Satori for our data access management.

  • Users posts chart link to request access to specific schemas -> DAR team approves request -> We grab chart/dataset id from query -> Integrate with Satori to automatically identify all schemas in the chart and grant the user access to them

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  • Change sql_query_mutator to add kwargs as comments. Note this will be reverted before committing (we don't want to change this)
    • Click view query on any chart in a dashboard. You should now see the chart_id, as well as the dataset_id
    • Screenshot 2023-08-23 at 4 34 57 PM

Changed query_obj tests to account for additional parameters:

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

@hwmarkcheng hwmarkcheng merged this pull request into master Sep 5, 2023
@hwmarkcheng hwmarkcheng deleted the hcheng/add-slice-to-mutator branch September 5, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant