duneanalytics / dune-client

A framework for interacting with Dune Analytics' officially supported API service
Apache License 2.0
85 stars 22 forks source link

AttributeError: 'DuneClient' object has no attribute 'get_latest_result' #60

Closed MSilb7 closed 1 year ago

MSilb7 commented 1 year ago

Hi, new error I started seeing today. get_latest_result started retuning that it doesn't exist: AttributeError: 'DuneClient' object has no attribute 'get_latest_result'

Not sure if it'a local environment thing or not.

Example implementation: https://github.com/ethereum-optimism/op-analytics/blob/main/contracts_tracking/test_get_result.ipynb Query result in Dune: https://dune.com/queries/2457627

I'm on version 1.1.1

bh2smith commented 1 year ago

This is very strange. I don't have time to look into this today, but will surely get back to it ASAP. In the meantime, I wonder if the original contributor might have some insight @grkhr on this one...

grkhr commented 1 year ago

Hey @MSilb7

Please show the output of pip show dune_client / pip3 show dune_client, seems that problem can be somewhere in versions

I'm facing no issues

>>> results = dune.get_latest_result('2457627')
>>> len(results.get_rows())
835
MSilb7 commented 1 year ago

Yeah it must be local. I use it in a github action, and it was fine. Locally:

pip show dune_client:

pip show dune_client
Name: dune-client
Version: 1.1.1
Summary: A simple framework for interacting with Dune Analytics official API service.
Home-page: https://github.com/cowprotocol/dune-client
Author: Benjamin H. Smith
Author-email: ben@cow.fi
License: Apache License Version 2.0
Location: /Users/michaelsilberling/opt/anaconda3/lib/python3.9/site-packages
Requires: aiohttp, ndjson, python-dateutil, requests, types-python-dateutil, types-PyYAML, types-requests, web3

Maybe python version / wrong conda environment is selected? I thought I was on 3.10+ hmmm.

MSilb7 commented 1 year ago

Yeah it's 100% a local thing. My conda environment says I have version 1.1.1, but when I print the version in my notebook, it shows 0.3.0 . I'll let you all know how I resolve it, thanks for checking!

MSilb7 commented 1 year ago

Ok resolved it. I was dumb and upgraded dune-client in my VSCode terminal without specifically activating my conda environment to do the upgrade. So my conda environment had version 0.3.0.

I activated my conda environment, upgraded, and now it works.

Resolved, closing. Big fan of dune-client haha.

image
bh2smith commented 1 year ago

Glad it's all good! Have fun Dune-ing