Skip to content

Commit

Permalink
Making some more changes to mitigate error
Browse files Browse the repository at this point in the history
  • Loading branch information
WillOfHeaven committed Mar 12, 2024
1 parent 48f7247 commit e55f34a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
# Send the API request and parse the JSON response
response = requests.get(url, params=params)
data_IBM = js.loads(response.text)
st.write(data_IBM.keys())
if 'Time Series (Daily)' in data_IBM:
daily_data = data_IBM['Time Series (Daily)']
else:
print("Error: 'Time Series (Daily)' key not found in data")
# Handle the missing key here (e.g., display an error message, try a different source)
#st.write(data_IBM)
try:
daily_data = data_IBM['Time Series (Daily)']
Expand Down

0 comments on commit e55f34a

Please sign in to comment.