From 3a59707621697721e6f26f5453a68ea0ab5ac3a6 Mon Sep 17 00:00:00 2001 From: anshulsri12 Date: Thu, 25 Jun 2020 21:33:58 +0530 Subject: [PATCH] Add feature to schedule query while creating them --- README.md | 4 ++++ redashAPI/client.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ffb0d4c..a95e4bb 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,10 @@ Redash.create_data_source("pg", "First Data Source", { - Custom options. +- **schedule (optional)** + + - Schedule configurations + ```python ### EXAMPLE ### diff --git a/redashAPI/client.py b/redashAPI/client.py index 477bfac..24a6adb 100644 --- a/redashAPI/client.py +++ b/redashAPI/client.py @@ -53,7 +53,7 @@ def create_data_source(self, _type: str, name: str, options: dict=None): return self.post('data_sources', payload) - def create_query(self, ds_id: int, name: str, qry: str, desc: str="", with_results: bool=True, options: dict=None): + def create_query(self, ds_id: int, name: str, qry: str, desc: str="", with_results: bool=True, options: dict=None, schedule: dict=None): if options is None or not isinstance(options, dict): options = {} @@ -62,7 +62,8 @@ def create_query(self, ds_id: int, name: str, qry: str, desc: str="", with_resul "name": name, "query": qry, "description": desc, - "options": options + "options": options, + "schedule": schedule } res = self.post('queries', payload)