Fixinttests (#1635)

* Added fix for finzin library

* Fixed options and screener

Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
This commit is contained in:
Colin Delahunty
2022-04-05 07:01:33 -04:00
committed by GitHub
parent 6eb0fbb1a6
commit 02ebdc6bb4
3 changed files with 10 additions and 1 deletions

View File

@@ -88,5 +88,8 @@ def get_comparison_data(data_type: str, similar: List[str]):
try:
return screen.screener_view(verbose=0)
except IndexError:
console.print("[red]Invalid data from website[red]")
console.print("[red]Invalid data from website[red]\n")
return pd.DataFrame()
except AttributeError:
console.print("[red]Invalid data from website[red]\n")
return pd.DataFrame()

View File

@@ -165,6 +165,9 @@ def view_historical_greeks(
ax.set_title(
f"{(greek).capitalize()} historical for {ticker.upper()} {strike} {['Call','Put'][put]}"
)
if df.empty:
console.print("[red]Data from API is not valid.[/red]\n")
return
ax.set_xlim(df.index[0], df.index[-1])
ims = im1 + im2
labels = [lab.get_label() for lab in ims]

View File

@@ -105,6 +105,9 @@ def get_screener_data(preset_loaded: str, data_type: str, limit: int, ascend: bo
except IndexError:
console.print("[red]Invalid data provided by the website[/red]\n")
return pd.DataFrame()
except AttributeError:
console.print("[red]Invalid data provided by the website[/red]\n")
return pd.DataFrame()
else:
preset_filter = configparser.RawConfigParser()