Scheduling Queries linkback isn't work #29834
-
I tried to add query scheduling using AirFlow using this instruction (https://superset.apache.org/docs/configuration/alerts-reports/#scheduling-queries-as-reports ), I change the "linkback" key in the SCHEDULED_QUERIES object, but there are no requests for this link where I click "submit". Perhaps this is a misunderstanding, I thought that SCHEDULED_QUERIES['backlink'] is the link that Superset will use to send the request with data after submitting the form. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@mikhail-moro Hello there! I'm a bot here to help you with bug resolutions, questions, and becoming a contributor. Let's tackle this issue together while we wait for a human maintainer. The To properly configure it, ensure that the SCHEDULED_QUERIES = {
'JSONSCHEMA': {
'title': 'Schedule',
'description': (
'In order to schedule a query, you need to specify when it '
'should start running, when it should stop running, and how '
'often it should run. You can also optionally specify '
'dependencies that should be met before the query is '
'executed. Please read the documentation for best practices '
'and more information on how to specify dependencies.'
),
'type': 'object',
'properties': {
'output_table': {
'type': 'string',
'title': 'Output table name',
},
'start_date': {
'type': 'string',
'title': 'Start date',
'format': 'date-time',
'default': 'tomorrow at 9am',
},
'end_date': {
'type': 'string',
'title': 'End date',
'format': 'date-time',
'default': '9am in 30 days',
},
'schedule_interval': {
'type': 'string',
'title': 'Schedule interval',
},
'dependencies': {
'type': 'array',
'title': 'Dependencies',
'items': {
'type': 'string',
},
},
},
},
'UISCHEMA': {
'schedule_interval': {
'ui:placeholder': '@daily, @weekly, etc.',
},
'dependencies': {
'ui:help': (
'Check the documentation for the correct format when '
'defining dependencies.'
),
},
},
'VALIDATION': [
{
'name': 'less_equal',
'arguments': ['start_date', 'end_date'],
'message': 'End date cannot be before start date',
'container': 'end_date',
},
],
'linkback': (
'https://airflow.example.com/admin/airflow/tree?'
'dag_id=query_${id}_${extra_json.schedule_info.output_table}'
),
} This configuration will add a "Schedule" menu item to SQL Lab, allowing users to specify scheduling details for their queries. The To apply this configuration, ensure that your export SUPERSET_CONFIG_PATH=/app/superset_config.py If you are using Docker, you can add your configuration file to the container and set the environment variable as follows: COPY --chown=superset superset_config.py /app/
ENV SUPERSET_CONFIG_PATH /app/superset_config.py Make sure to restart your Superset instance after making these changes to apply the new configuration. Additionally, the |
Beta Was this translation helpful? Give feedback.
The
onScheduleSubmit
function itself does not handle the navigation to the scheduler's interface. Instead, thelinkback
URL in theSCHEDULED_QUERIES
configuration is used to generate a link that users can follow to view the status or details of the scheduled query in the scheduler's interface (e.g., Airflow).Here's a breakdown of how it works:
Configuration: The
linkback
URL is defined in theSCHEDULED_QUERIES
configuration in yoursuperset_config.py
file. This URL is constructed with placeholders that are replaced with actual query details when the link is generated.