From aaa2ee02bac8bbf8e5e077d66754c5737d27ab9f Mon Sep 17 00:00:00 2001 From: dbernaciak Date: Sun, 26 Nov 2023 22:07:17 -0500 Subject: [PATCH] fix mypy --- fusion/fusion.py | 5 ++++- fusion/utils.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fusion/fusion.py b/fusion/fusion.py index e63579a..7f45220 100755 --- a/fusion/fusion.py +++ b/fusion/fusion.py @@ -4,7 +4,7 @@ import sys import warnings from pathlib import Path -from typing import Dict, List, Union +from typing import Dict, List, Union, Optional from zipfile import ZipFile import json as js import pandas as pd @@ -1124,6 +1124,7 @@ async def async_events(): th = threading.Thread(target=asyncio.run, args=(async_events(),), daemon=True) th.start() + return None def get_events( self, last_event_id: str = None, catalog: str = None, in_background: bool = True @@ -1159,5 +1160,7 @@ def get_events( return pd.DataFrame(lst) except Exception as e: raise Exception(e) + finally: + return None else: return self.events diff --git a/fusion/utils.py b/fusion/utils.py index bddc509..7b05450 100644 --- a/fusion/utils.py +++ b/fusion/utils.py @@ -92,7 +92,7 @@ def __call__(self, *args, **kwargs): tqdm_object.close() -def cpu_count(thread_pool_size: int = None): +def cpu_count(thread_pool_size: int = None) -> int: """Determine the number of cpus/threads for parallelization. Args: @@ -158,7 +158,9 @@ def json_to_table(path: str, fs=None, columns: list = None, filters: list = None return tbl -def parquet_to_table(path: str, fs=None, columns: list = None, filters: list = None): +def parquet_to_table( + path: Union[str, list], fs=None, columns: list = None, filters: list = None +): """Reads parquet data to pyarrow table. Args: