Skip to content

Commit

Permalink
Revert "chore: disable deprecated streamlit features"
Browse files Browse the repository at this point in the history
This reverts commit 9dff5cc.
  • Loading branch information
Elijas committed Jun 9, 2024
1 parent a095800 commit bbe0853
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
9 changes: 5 additions & 4 deletions dev_utils/dashboard_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
### Persistence ###
###################

url_params_queries = st.query_params.get_all("q")
url_query_params = st.experimental_get_query_params()
url_params_queries = url_query_params.get("q", [])

if "select_reports__queries" not in st.session_state:
default = ""
Expand All @@ -71,7 +72,7 @@

if "view_parsed__filter_by_text" not in st.session_state:
default = None
if url_filter_by_text := st.query_params.get_all(URL_PARAM_KEY_FILTER_BY_TEXT):
if url_filter_by_text := url_query_params.get(URL_PARAM_KEY_FILTER_BY_TEXT, []):
default = url_filter_by_text[0]
st.session_state["view_parsed__filter_by_text"] = default

Expand Down Expand Up @@ -102,9 +103,9 @@ def deserialize(cls, name: str):

default_nav_bar_selection = NavbarItems.SELECT_REPORTS.value
try:
if URL_PARAM_KEY in st.query_params:
if URL_PARAM_KEY in url_query_params:
default_nav_bar_selection = NavbarItems.deserialize(
st.query_params[URL_PARAM_KEY],
url_query_params[URL_PARAM_KEY][0]
).value
except Exception as e:
st.toast(
Expand Down
2 changes: 1 addition & 1 deletion dev_utils/dashboard_app/streamlit_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get_style_modify_decoration():


def get_style_change_top_page_margin():
return "div[class^='block-container'] { padding-top: 2.8rem; }".strip()
return "div[class^='block-container'] { padding-top: 2rem; }".strip()


def st_keep(key, value_func=None) -> None:
Expand Down
5 changes: 1 addition & 4 deletions dev_utils/dashboard_app/view_parsed/semantic_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ def render_view_parsed_semantic_elements(
do_show_nested_composite_elements: bool,
are_any_elements_filtered: bool,
):
url_params = st.query_params
url_params = (
{}
) # TODO: Temporarily disabled until https://github.com/alphanome-ai/sec-parser/issues/85 is solved
url_params = st.experimental_get_query_params()
new_url_params = []
pagination_size = None
do_use_pagination = len(elements) >= PAGINATION_DISABLE_THRESHOLD
Expand Down
6 changes: 2 additions & 4 deletions dev_utils/dashboard_app/view_parsed/view_parsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def render_view_parsed():
return
metadatas: list[FilingMetadata] = st.session_state.select_reports__report_metadatas

url_params = st.query_params
url_params = {} # TODO: Temporarily disabled until https://github.com/alphanome-ai/sec-parser/issues/85 is solved
url_params = st.experimental_get_query_params()
new_url_params = []

#################
Expand Down Expand Up @@ -103,8 +102,7 @@ def serialize(self):
def deserialize(cls, name: str):
return ViewParsedItems[name.upper()]

url_query_params = st.query_params
url_query_params = {} # TODO: Temporarily disabled until https://github.com/alphanome-ai/sec-parser/issues/85 is solved
url_query_params = st.experimental_get_query_params()
default_nav_bar_selection = ViewParsedItems.SEMANTIC_ELEMENTS.value
try:
if URL_PARAM_KEY in url_query_params:
Expand Down

0 comments on commit bbe0853

Please sign in to comment.