Skip to content

Commit

Permalink
add dict for datasource as sub_query return dict (#179)
Browse files Browse the repository at this point in the history
* add dict for datasource as sub_query return dict

* add dict for datasource as sub_query return dict

* add dict for datasource as sub_query return dict

Co-authored-by: lavanya <lavanya@dataglen.com>
  • Loading branch information
pantlavanya and lavanya authored May 22, 2020
1 parent 502850a commit 866b54e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pydruid/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,20 @@ def parse_datasource(datasource, query_type):
:param datasource: datasource parameter
:param string query_type: query type
:raise ValueError: if input is not string or list of strings
:raise ValueError: if input is not string or list of strings or dict
"""
if not (
isinstance(datasource, six.string_types)
or (
isinstance(datasource, list)
and all([isinstance(x, six.string_types) for x in datasource])
)
or
isinstance(datasource, dict)
):
raise ValueError(
"Datasource definition not valid. Must be string or list of strings"
"Datasource definition not valid. Must be string or "
"dict or list of strings"
)
if isinstance(datasource, six.string_types):
return datasource
Expand Down

0 comments on commit 866b54e

Please sign in to comment.