diff --git a/data_explorer/app/config.py b/data_explorer/app/config.py index 4b7519b05..833f434c8 100644 --- a/data_explorer/app/config.py +++ b/data_explorer/app/config.py @@ -11,5 +11,6 @@ "partition", ] +DEFAULT_INDEX_NAME = "id" + ROWS_TO_RETURN = 20 -ROWS_PER_PAGE = 10 diff --git a/data_explorer/app/df_helpers/fields.py b/data_explorer/app/df_helpers/fields.py index e13eab17f..4e324da25 100644 --- a/data_explorer/app/df_helpers/fields.py +++ b/data_explorer/app/df_helpers/fields.py @@ -2,25 +2,29 @@ import typing as t +from fondant.core.schema import Field + def get_fields_by_types( - fields: t.Dict[str, str], + fields: t.Dict[str, Field], field_types: t.List[str], ) -> t.List[str]: - return [ - field - for field, f_type in fields.items() - if any(ftype in f_type for ftype in field_types) - ] + filtered_fields = [] + + for field, f_type in fields.items(): + if any(ftype in f_type.type.to_json()["type"] for ftype in field_types): + filtered_fields.append(field) + + return filtered_fields -def get_string_fields(fields: t.Dict[str, str]) -> t.List[str]: +def get_string_fields(fields: t.Dict[str, Field]) -> t.List[str]: return get_fields_by_types(fields, ["string", "utf8"]) -def get_image_fields(fields: t.Dict[str, str]) -> t.List[str]: +def get_image_fields(fields: t.Dict[str, Field]) -> t.List[str]: return get_fields_by_types(fields, ["binary"]) -def get_numeric_fields(fields: t.Dict[str, str]) -> t.List[str]: +def get_numeric_fields(fields: t.Dict[str, Field]) -> t.List[str]: return get_fields_by_types(fields, ["int", "float"]) diff --git a/data_explorer/app/interfaces/common_interface.py b/data_explorer/app/interfaces/common_interface.py index b322612fb..469344d24 100644 --- a/data_explorer/app/interfaces/common_interface.py +++ b/data_explorer/app/interfaces/common_interface.py @@ -64,6 +64,7 @@ class MainInterface: def __init__(self): app_interface = AppStateInterface() app_interface.initialize() + st.set_page_config(layout="wide") self.fs, _ = fsspec.core.url_to_fs(st.session_state["base_path"]) def _display_base_info(self): @@ -116,7 +117,7 @@ def create_common_interface(self): add_logo("content/fondant_logo.png") with st.sidebar: - # Increase the width of the sidebar to accomodate logo + # Increase the width of the sidebar to accommodate logo st.markdown( """