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

feat(logs context): Adding dashboard id to logs context #27298

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

Vitor-Avila
Copy link
Contributor

@Vitor-Avila Vitor-Avila commented Feb 29, 2024

SUMMARY

Includes the dashboard_id information to the logs context, so that it can be included in the sql mutator. Refer to below links for additional context:

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

No UI changes.

TESTING INSTRUCTIONS

  1. Update the sql mutator logic to get data from the logs context. For example:
def mutator(sql: str, **kwargs: Any) -> str:
    if dashboard_id := g.logs_context.get("dashboard_id"):
        output = (
            f"-- Metadata:\n"
            + f"-- dashboard_id: {dashboard_id}\n"
        )
        return output + f"{sql}"
    return sql
  1. Access a dashboard, and click on the three ellipses for any chart > View query.
  2. Validate that the dashboard ID is included in the query comments.

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

@github-actions github-actions bot added the api Related to the REST API label Feb 29, 2024
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.69%. Comparing base (b16c899) to head (d410355).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27298      +/-   ##
==========================================
+ Coverage   69.57%   69.69%   +0.11%     
==========================================
  Files        1908     1908              
  Lines       74543    74543              
  Branches     8313     8313              
==========================================
+ Hits        51866    51953      +87     
+ Misses      20625    20538      -87     
  Partials     2052     2052              
Flag Coverage Δ
hive 53.78% <ø> (?)
mysql 78.00% <ø> (ø)
postgres 78.10% <ø> (ø)
presto 53.73% <ø> (?)
python 83.12% <ø> (+0.24%) ⬆️
sqlite 77.62% <ø> (ø)
unit 56.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

Thanks @Vitor-Avila!

@eschutho eschutho merged commit 9beee92 into apache:master Feb 29, 2024
34 checks passed
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 4, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 7, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 8, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 14, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 19, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 22, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 26, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 26, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 28, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 1, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 2, 2024
betodealmeida pushed a commit that referenced this pull request Apr 25, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
eschutho pushed a commit that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants