Skip to content

Data fetching treasury_inflows_outflows not working. #4

@LinuxIsCool

Description

@LinuxIsCool
from conding.dune.tec import TECDashboard

tec = TECDashboard()

tec.treasury_inflows_outflows.multisig_values_over_time()

Results:

2023-07-25 14:27:54,600 INFO dune_client.base_client executing 945136 on medium cluster
2023-07-25 14:27:55,354 ERROR dune_client.models Can't build ExecutionResponse from {'error': 'Deprecated query engine, please see: https://dune.com/docs/query/Old-Query-Engines/'} due to KeyError: 'execution_id'

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/dune_client/client.py:92, in DuneClient.execute(self, query, performance)
     91 try:
---> 92     return ExecutionResponse.from_dict(response_json)
     93 except KeyError as err:

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/dune_client/models.py:77, in ExecutionResponse.from_dict(cls, data)
     75 """Constructor from dictionary. See unit test for sample input."""
     76 return cls(
---> 77     execution_id=data["execution_id"], state=ExecutionState(data["state"])
     78 )

KeyError: 'execution_id'

The above exception was the direct cause of the following exception:

DuneError                                 Traceback (most recent call last)
Cell In[12], line 5
      1 from conding.dune.tec import TECDashboard
      3 tec = TECDashboard()
----> 5 tec.treasury_inflows_outflows.multisig_values_over_time()

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/conding/dune/tec.py:92, in TECDashboard.TreasuriesInflowsOutflows.multisig_values_over_time(self, **params)
     90 def multisig_values_over_time(self, **params):
     91     """NOT WORKING"""
---> 92     df = self.refresh_into_dataframe(945136, **params)
     93     return df

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/conding/dune/dune.py:38, in DuneWrapper.refresh_into_dataframe(self, query_id, params, name, update_cache)
     36     df = self.cache[cache_key]
     37 else:
---> 38     df = self.dune.refresh_into_dataframe(query=query)
     39     self.cache[cache_key] = df
     40 return df

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/dune_client/client.py:239, in DuneClient.refresh_into_dataframe(self, query, performance)
    235 except ImportError as exc:
    236     raise ImportError(
    237         "dependency failure, pandas is required but missing"
    238     ) from exc
--> 239 data = self.refresh_csv(query, performance=performance).data
    240 return pandas.read_csv(data)

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/dune_client/client.py:217, in DuneClient.refresh_csv(self, query, ping_frequency, performance)
    206 def refresh_csv(
    207     self,
    208     query: Query,
    209     ping_frequency: int = 5,
    210     performance: Optional[str] = None,
    211 ) -> ExecutionResultCSV:
    212     """
    213     Executes a Dune query, waits till execution completes,
    214     fetches and the results in CSV format
    215     (use it load the data directly in pandas.from_csv() or similar frameworks)
    216     """
--> 217     job_id = self._refresh(
    218         query,
    219         ping_frequency=ping_frequency,
    220         performance=performance,
    221     )
    222     return self.get_result_csv(job_id)

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/dune_client/client.py:174, in DuneClient._refresh(self, query, ping_frequency, performance)
    168 def _refresh(
    169     self,
    170     query: Query,
    171     ping_frequency: int = 5,
    172     performance: Optional[str] = None,
    173 ) -> str:
--> 174     job_id = self.execute(query=query, performance=performance).execution_id
    175     status = self.get_status(job_id)
    176     while status.state not in ExecutionState.terminal_states():

File ~/.cache/pypoetry/virtualenvs/tec-MrjTjlJ--py3.10/lib/python3.10/site-packages/dune_client/client.py:94, in DuneClient.execute(self, query, performance)
     92     return ExecutionResponse.from_dict(response_json)
     93 except KeyError as err:
---> 94     raise DuneError(response_json, "ExecutionResponse", err) from err

DuneError: Can't build ExecutionResponse from {'error': 'Deprecated query engine, please see: https://dune.com/docs/query/Old-Query-Engines/'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions