Giter VIP home page Giter VIP logo

Comments (4)

dosubot avatar dosubot commented on September 13, 2024 2

To address the issue of parameters not being included when sharing a query link in Apache Superset, especially when using templating in SQL Lab, it's important to understand the mechanisms Superset provides for sharing queries. There are two main methods to share queries with parameters:

  1. Sharing via KV Store: This method is available if the ShareQueriesViaKvStore feature flag is enabled. It allows sharing a query with parameters by generating a short URL. The query and its parameters (templateParams) are stored in a key-value store, and the shared link references this stored query.

  2. Sharing Saved Queries: When a query is saved, it can be shared using a direct link that includes the savedQueryId parameter. For this method, ensure the query is saved with all necessary parameters in the templateParams field. The shared link will allow recipients to access the query along with its parameters.

To ensure your parameters are included when sharing a query link:

  • Verify that the templateParams field is correctly populated before saving or sharing the query.
  • If using the KV Store method, ensure the ShareQueriesViaKvStore feature flag is enabled.
  • Confirm that your Superset version supports these features. If not, updating to the latest version or consulting the Superset documentation may be necessary.

These steps should help in sharing query links that include all necessary parameters, facilitating recipients to view and interact with the shared queries as intended. For more detailed implementation, you can refer to the source code in the superset-frontend/src/SqlLab/components/ShareSqlLabQuery/index.tsx and the relevant migrations in the Superset GitHub repository.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from superset.

dosubot avatar dosubot commented on September 13, 2024 2

To resolve the issue with template_params not being included when sharing a query link in Apache Superset, follow these targeted steps:

  1. Correctly Set Template Parameters: Ensure you're using the TemplateParamsEditor to input your template parameters as JSON. This ensures they're correctly set for Jinja templating in your SQL queries.

  2. Serialization and Retrieval: When saving or sharing a query, the templateParams must be serialized correctly and included in the URL. Upon opening a shared query link, Superset should deserialize these parameters and load them into the SQL Lab context. This process is crucial for the parameters to be recognized and used in the shared query.

  3. Database and Migration Check: Confirm that your Superset instance includes the migration adding a template_parameters column in the saved_query table. This column is essential for storing and retrieving template parameters in saved queries, ensuring they persist when sharing query links.

  4. Debugging and Testing: If the issue persists, debug by checking the URL generation to ensure templateParams are included, and verify that upon opening the link, parameters are correctly parsed and set into the application's state. Also, ensure your error handling logic is robust to catch and report any issues with template parameters.

By ensuring the correct setup and handling of template_params, you can improve the reliability of sharing query links with parameters in Apache Superset.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from superset.

Hammam94 avatar Hammam94 commented on September 13, 2024 1

i got this error when creating the link
There was an error with your request
and here is the network response
Screen Shot 2024-05-21 at 8 54 11 AM

from superset.

Hammam94 avatar Hammam94 commented on September 13, 2024

For fruther information form the network
Screen Shot 2024-05-20 at 4 20 37 PM

You can see the template_params returns with null while when i saved it i checked the network and i can see the template_params has value

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.