From a7c94a261a06d271a4c9c6fe8c6c5cd2a0438160 Mon Sep 17 00:00:00 2001 From: agaperste Date: Wed, 22 Nov 2023 17:25:35 -0500 Subject: [PATCH 1/2] ENG-399 and ENG-375 (fixing create_query is_private=True & adding performance param for run_sql --- dune_client/api/extensions.py | 6 ++++-- dune_client/api/query.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dune_client/api/extensions.py b/dune_client/api/extensions.py index 6ffec1b..3e7877c 100644 --- a/dune_client/api/extensions.py +++ b/dune_client/api/extensions.py @@ -195,6 +195,8 @@ def run_sql( params: Optional[list[QueryParameter]] = None, is_private: bool = True, archive_after: bool = True, + performance: Optional[str] = None, + name: str = "API Query", ) -> ResultsResponse: """ Allows user to provide execute raw_sql via the CRUD interface @@ -202,8 +204,8 @@ def run_sql( - Query is by default made private and archived after execution. Requires premium subscription! """ - query = self.create_query("API Query", query_sql, params, is_private) - results = self.run_query(query.base) + query = self.create_query(name, query_sql, params, is_private) + results = self.run_query(query=query.base, performance=performance) if archive_after: self.archive_query(query.base.query_id) return results diff --git a/dune_client/api/query.py b/dune_client/api/query.py index dafd9ec..c70c01f 100644 --- a/dune_client/api/query.py +++ b/dune_client/api/query.py @@ -33,7 +33,7 @@ def create_query( payload = { "name": name, "query_sql": query_sql, - "private": is_private, + "is_private": is_private, } if params is not None: payload["parameters"] = [p.to_dict() for p in params] From d04a8ec5be1068b1f2eb30b2c54600b170f9c6c8 Mon Sep 17 00:00:00 2001 From: agaperste Date: Wed, 22 Nov 2023 17:37:05 -0500 Subject: [PATCH 2/2] expanding max args for lint --- .pylintrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index f4b7573..7130db2 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,2 +1,4 @@ [MASTER] -disable=fixme,logging-fstring-interpolation \ No newline at end of file +disable=fixme,logging-fstring-interpolation +[DESIGN] +max-args=10