update example notebook syntax for metadata change (#6287)

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
This commit is contained in:
Danglewood
2024-04-04 08:02:56 -07:00
committed by GitHub
parent daa4520fea
commit 45998938ed

View File

@@ -20,12 +20,10 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"\n",
"from openbb import obb\n",
"from pandas import DataFrame\n"
]
@@ -42,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
@@ -50,15 +48,15 @@
"text/plain": [
"OBBject\n",
"\n",
"id: 06580cab-5bdc-7e28-8000-632a5d8dc92f\n",
"results: [{'date': datetime.date(2002, 12, 18), 'WALCL': 719542.0, 'WLRRAL': 21905....\n",
"id: 0660e135-3511-73d7-8000-b792f7e418bb\n",
"results: [{'date': datetime.date(2002, 12, 18), 'provider': 'fred', 'WALCL': 719542...\n",
"provider: fred\n",
"warnings: [{'category': 'UserWarning', 'message': '{\"WALCL\": {\"title\": \"Assets: Tot...\n",
"warnings: None\n",
"chart: None\n",
"extra: {'metadata': {'arguments': {'provider_choices': {'provider': None}, 'standar..."
"extra: {'results_metadata': {'WALCL': {'title': 'Assets: Total Assets: Total Assets..."
]
},
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
@@ -78,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 3,
"metadata": {},
"outputs": [
{
@@ -110,7 +108,7 @@
}
],
"source": [
"metadata = json.loads(data.warnings[0].message)\n",
"metadata = data.extra[\"results_metadata\"]\n",
"\n",
"display(metadata.keys())\n",
"display(metadata[\"WALCL\"].get(\"title\"))\n",
@@ -573,7 +571,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 5,
"metadata": {},
"outputs": [
{
@@ -10197,7 +10195,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.7"
},
"orig_nbformat": 4
},