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

[FEATURE]: Add schedule parameter in create query #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ Redash.create_data_source("pg", "First Data Source", {

- Custom options.

- **schedule (optional)**

- Schedule configurations

```python
### EXAMPLE ###

Expand Down
5 changes: 3 additions & 2 deletions redashAPI/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand All @@ -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)
Expand Down