cyberosa commited on
Commit
89572c9
·
1 Parent(s): a899051

adding new pearl agents dataset

Browse files
Files changed (2) hide show
  1. pearl_agents.parquet +3 -0
  2. scripts/daa.py +17 -0
pearl_agents.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:714bdee7683c7ad84d49660ca5825d2fbf6a90922ed7a72e12a4d27603f89708
3
+ size 50256
scripts/daa.py CHANGED
@@ -204,6 +204,19 @@ def get_latest_result_from_DAA_Pearl(dune_client: DuneClient):
204
  return query_result
205
 
206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  def prepare_daa_data():
208
  # patch_http_connection_pool()
209
  dune = setup_dune_python_client()
@@ -220,6 +233,10 @@ def prepare_daa_data():
220
  df.to_parquet(
221
  ROOT_DIR / "latest_result_DAA_Pearl.parquet", index=False, compression="gzip"
222
  )
 
 
 
 
223
 
224
 
225
  if __name__ == "__main__":
 
204
  return query_result
205
 
206
 
207
+ def get_the_list_of_pearl_agents(dune_client: DuneClient):
208
+ """Function to get the list of pearl agents from Dune"""
209
+ query = QueryBase(
210
+ query_id=5194206,
211
+ )
212
+ # query_result = dune_client.run_query_dataframe(query=query)
213
+ query_result = dune_client.get_latest_result_dataframe(5194206)
214
+ print(f"Pearl agents query result = {query_result.head()}")
215
+ # keep only the columns: safe_address, service_id, service_owner
216
+ query_result = query_result[["safe_address", "serviceId", "service_owner"]]
217
+ return query_result
218
+
219
+
220
  def prepare_daa_data():
221
  # patch_http_connection_pool()
222
  dune = setup_dune_python_client()
 
233
  df.to_parquet(
234
  ROOT_DIR / "latest_result_DAA_Pearl.parquet", index=False, compression="gzip"
235
  )
236
+ # GEt the list of pearl agents
237
+ df = get_the_list_of_pearl_agents(dune)
238
+ # Save the result to a parquet file
239
+ df.to_parquet(ROOT_DIR / "pearl_agents.parquet", index=False, compression="gzip")
240
 
241
 
242
  if __name__ == "__main__":