mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
Ark_orders failing since no data exists in website when combined selected
This commit is contained in:
@@ -41,6 +41,10 @@ def get_ark_orders() -> DataFrame:
|
||||
parsed_json = json.loads(parsed_script.string)
|
||||
|
||||
df_orders = pd.json_normalize(parsed_json["props"]["pageProps"]["arkTrades"])
|
||||
|
||||
if df_orders.empty:
|
||||
return pd.DataFrame()
|
||||
|
||||
df_orders.drop(
|
||||
[
|
||||
"everything",
|
||||
@@ -116,6 +120,10 @@ def ark_orders(l_args):
|
||||
|
||||
df_orders = get_ark_orders()
|
||||
|
||||
if df_orders.empty:
|
||||
print("The ARK orders aren't anavilable at the moment.\n")
|
||||
return
|
||||
|
||||
pd.set_option("mode.chained_assignment", None)
|
||||
df_orders = add_order_total(df_orders.head(ns_parser.n_num))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user