From d53276afd03ab585cc8db9bf201c715742c46daa Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Sat, 12 Apr 2025 21:44:03 +0300 Subject: [PATCH] fix: typing cast --- scripts/preview_query.py | 3 ++- scripts/pull_from_dune.py | 3 ++- scripts/push_to_dune.py | 3 ++- scripts/upload_to_dune.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/preview_query.py b/scripts/preview_query.py index 0268db6..8255609 100644 --- a/scripts/preview_query.py +++ b/scripts/preview_query.py @@ -3,11 +3,12 @@ from dotenv import load_dotenv import sys import pandas as pd +from typing import cast dotenv_path = os.path.join(os.path.dirname(__file__), '..', '.env') load_dotenv(dotenv_path) -dune = DuneClient.from_env() +dune = cast(DuneClient, DuneClient.from_env()) #get id passed in python script invoke id = sys.argv[1] diff --git a/scripts/pull_from_dune.py b/scripts/pull_from_dune.py index 9b60313..83e00f3 100644 --- a/scripts/pull_from_dune.py +++ b/scripts/pull_from_dune.py @@ -4,6 +4,7 @@ from dotenv import load_dotenv import sys import codecs +from typing import cast # Set the default encoding to UTF-8 sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) @@ -11,7 +12,7 @@ dotenv_path = os.path.join(os.path.dirname(__file__), '..', '.env') load_dotenv(dotenv_path) -dune = DuneClient.from_env() +dune = cast(DuneClient, DuneClient.from_env()) # Read the queries.yml file queries_yml = os.path.join(os.path.dirname(__file__), '..', 'queries.yml') diff --git a/scripts/push_to_dune.py b/scripts/push_to_dune.py index 69de9b8..cae9344 100644 --- a/scripts/push_to_dune.py +++ b/scripts/push_to_dune.py @@ -4,6 +4,7 @@ from dotenv import load_dotenv import sys import codecs +from typing import cast # Set the default encoding to UTF-8 sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) @@ -11,7 +12,7 @@ dotenv_path = os.path.join(os.path.dirname(__file__), '..', '.env') load_dotenv(dotenv_path) -dune = DuneClient.from_env() +dune = cast(DuneClient, DuneClient.from_env()) # Read the queries.yml file queries_yml = os.path.join(os.path.dirname(__file__), '..', 'queries.yml') diff --git a/scripts/upload_to_dune.py b/scripts/upload_to_dune.py index 1eec72c..e7bc232 100644 --- a/scripts/upload_to_dune.py +++ b/scripts/upload_to_dune.py @@ -4,6 +4,7 @@ import sys import codecs import os +from typing import cast # Set the default encoding to UTF-8 sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach()) @@ -11,7 +12,7 @@ dotenv_path = os.path.join(os.path.dirname(__file__), '..', '.env') load_dotenv(dotenv_path) -dune = DuneClient.from_env() +dune = cast(DuneClient, DuneClient.from_env()) uploads_path = os.path.join(os.path.dirname(__file__), '..', 'uploads') files = os.listdir(uploads_path)