Fixed import bug in report and dashboard notebooks (#1632)

This commit is contained in:
Colin Delahunty
2022-04-05 05:34:04 -04:00
committed by GitHub
parent b4e44d23d0
commit ea0a3bbc5c
4 changed files with 16 additions and 11 deletions

View File

@@ -91,7 +91,11 @@ def get_global_market() -> pd.DataFrame:
for key, date in global_markets.items():
if "date" in key:
try:
global_markets[key] = parser.parse(date).strftime("%Y-%m-%d %H:%M:%S")
if isinstance(date, datetime):
new_date = date
else:
new_date = parser.parse(date)
global_markets[key] = new_date.strftime("%Y-%m-%d %H:%M:%S")
except (KeyError, ValueError, TypeError) as e:
logger.exception(str(e))
console.print(e)

View File

@@ -15,13 +15,14 @@
"import numpy as np\n",
"import pandas as pd\n",
"from IPython.display import display\n",
"from openbb_terminal import api as openbb\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"module_path = os.path.abspath(os.path.join(\"../..\"))\n",
"module_path = os.path.abspath(os.path.join(\"../../..\"))\n",
"\n",
"if module_path not in sys.path:\n",
" sys.path.append(module_path)"
" sys.path.append(module_path)\n",
"\n",
"from openbb_terminal import api as openbb"
]
},
{
@@ -153,7 +154,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.8.13"
}
},
"nbformat": 4,

View File

@@ -15,7 +15,7 @@
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"module_path = os.path.abspath(os.path.join(\"../..\"))\n",
"module_path = os.path.abspath(os.path.join(\"../../..\"))\n",
"\n",
"if module_path not in sys.path:\n",
" sys.path.append(module_path)"
@@ -254,7 +254,7 @@
"hash": "158b8ab50e95ded652d8f2b468df64cac8eaa223c5e60f12cdaaeaccc6039b6d"
},
"kernelspec": {
"display_name": "Python 3.8.12 64-bit ('gst': conda)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -268,7 +268,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.10"
"version": "3.8.13"
}
},
"nbformat": 4,

View File

@@ -231,9 +231,9 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": ""
"name": "python3"
},
"language_info": {
"codemirror_mode": {
@@ -245,7 +245,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.8.13"
}
},
"nbformat": 4,