Skip to content

Commit

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

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

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

if "view_parsed__filter_by_text" not in st.session_state:
default = None
if url_filter_by_text := url_query_params.get(URL_PARAM_KEY_FILTER_BY_TEXT, []):
if url_filter_by_text := st.query_params.get_all(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 @@ -103,9 +102,9 @@ def deserialize(cls, name: str):

default_nav_bar_selection = NavbarItems.SELECT_REPORTS.value
try:
if URL_PARAM_KEY in url_query_params:
if URL_PARAM_KEY in st.query_params:
default_nav_bar_selection = NavbarItems.deserialize(
url_query_params[URL_PARAM_KEY][0]
st.query_params[URL_PARAM_KEY],
).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: 2rem; }".strip()
return "div[class^='block-container'] { padding-top: 2.8rem; }".strip()


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

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

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

url_query_params = st.experimental_get_query_params()
url_query_params = st.query_params
url_query_params = {} # TODO: Temporarily disabled until https://github.com/alphanome-ai/sec-parser/issues/85 is solved
default_nav_bar_selection = ViewParsedItems.SEMANTIC_ELEMENTS.value
try:
if URL_PARAM_KEY in url_query_params:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sec-parser"
version = "0.56.1"
version = "0.56.2"
description = "Parse SEC EDGAR HTML documents into a tree of elements that correspond to the visual structure of the document."
authors = ["Alphanome.AI <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 9dff5cc

Please sign in to comment.