rysuds / dunebuggy

Lightweight Python Client for Dune Analytics
MIT License
24 stars 8 forks source link

Example doesn't run #14

Closed Arcanesaadman15 closed 2 years ago

Arcanesaadman15 commented 2 years ago

When running the example given:

from dunebuggy import Dune

dune = Dune() query = dune.fetch_query(83579)

this error comes

Traceback (most recent call last): File "/Users/saadman/Desktop/Library_ens_bots/dune_test.py", line 4, in query = dune.fetch_query(83579) File "/opt/homebrew/lib/python3.9/site-packages/dunebuggy/core/dune.py", line 104, in fetch_query metadata = self.gqlquerier.get_query_metadata(query_id, self.user_id) File "/opt/homebrew/lib/python3.9/site-packages/dunebuggy/core/gqlquerier.py", line 49, in get_query_metadata raw_metadata = self.post_graph_ql(QueryName.FIND_QUERY, variables) File "/opt/homebrew/lib/python3.9/site-packages/dunebuggy/core/gqlquerier.py", line 30, in post_graph_ql response_json = response.json() File "/opt/homebrew/lib/python3.9/site-packages/httpx/_models.py", line 742, in json return jsonlib.loads(self.content.decode(encoding), **kwargs) File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/homebrew/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

gugus13400 commented 2 years ago

Got the same issue, its because they did not update their endpoint. So Clone the repo then navigate towards dunebuggy -> models -> constants.py and update their endpoint variable to GRAPH_QL_URL = "https://core-hsr.dune.com/v1/graphql" 👍

rysuds commented 2 years ago

Fixed thanks to @nabetse00

allenzhao commented 1 year ago

@rysuds It seems that the released version on PyPI still uses the old GRAPH_QL_URL. Can you help fix this? Thanks!