Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernaciak committed Nov 27, 2023
1 parent 7f23937 commit aaa2ee0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion fusion/fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions fusion/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit aaa2ee0

Please sign in to comment.