Skip to content

Commit

Permalink
Change timedelta import
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Jul 20, 2024
1 parent 9cb47ec commit cb1e8fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package_build/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import datetime
from datetime import timedelta

import requests
import streamlit as st
Expand All @@ -17,13 +17,13 @@ def get_json(url: str) -> list[dict]:
hook_metadata_url = metadata_url_base + "hook_v2.json"


@st.cache_data(show_spinner="Getting hook metadata...", ttl=datetime.timedelta(minutes=15))
@st.cache_data(show_spinner="Getting hook metadata...", ttl=timedelta(minutes=15))
def get_hook_metadata() -> list[HookInfoEntry]:
data = get_json(hook_metadata_url)
return [HookInfoEntry.model_validate(item) for item in data]


@st.cache_data(show_spinner="Getting dict metadata...", ttl=datetime.timedelta(minutes=15))
@st.cache_data(show_spinner="Getting dict metadata...", ttl=timedelta(minutes=15))
def get_dict_metadata() -> list[DictInfoEntry]:
data = get_json(dict_metadata_url)
return [DictInfoEntry.model_validate(item) for item in data if item.get("code")]

0 comments on commit cb1e8fa

Please sign in to comment.