From 7a7eb256d9482e9439f52f0c3733520f96e3c59f Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Simonard Date: Mon, 16 Dec 2024 10:01:14 +0100 Subject: [PATCH] Fix #505 --- ragna/deploy/_ui/components/metadata_filters_builder.py | 6 +----- ragna/deploy/_ui/modal_configuration.py | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ragna/deploy/_ui/components/metadata_filters_builder.py b/ragna/deploy/_ui/components/metadata_filters_builder.py index 83f77432..b1a11c5b 100644 --- a/ragna/deploy/_ui/components/metadata_filters_builder.py +++ b/ragna/deploy/_ui/components/metadata_filters_builder.py @@ -151,7 +151,6 @@ def __init__(self, corpus_metadata, **params): ) self.add_filter_row_button.on_click(self.add_filter_row) - def create_filter_row(self): return [ FilterRow( @@ -184,7 +183,7 @@ def render_filters_rows(self): *self.filter_rows, css_classes=["metadata-filter-row-collection"], ) - + def construct_metadata_filters(self): metadata_filters = [ filter_row.construct_metadata_filter() @@ -197,8 +196,6 @@ def construct_metadata_filters(self): return MetadataFilter.and_(metadata_filters).to_primitive() def __panel__(self): - - if len(self.corpus_names) == 0: return pn.Column( pn.pane.HTML("No corpus available for selected source storage"), @@ -206,7 +203,6 @@ def __panel__(self): height_policy="max", ) - return pn.Column( self.corpus_names_select, pn.pane.HTML("Metadata Filters"), diff --git a/ragna/deploy/_ui/modal_configuration.py b/ragna/deploy/_ui/modal_configuration.py index 8172e99e..17ab87d2 100644 --- a/ragna/deploy/_ui/modal_configuration.py +++ b/ragna/deploy/_ui/modal_configuration.py @@ -414,7 +414,6 @@ def add_error_message(self): ) def corpus_or_upload_row(self): if self.corpus_or_upload == USE_CORPUS_LABEL: - if self.config.source_storage_name in self.corpus_names: corpus_names = self.corpus_names[self.config.source_storage_name] else: @@ -430,7 +429,9 @@ def corpus_or_upload_row(self): ) if len(corpus_names) > 0: - data = pn.Column(self.metadata_filter_rows_title, self.metadata_filter_rows) + data = pn.Column( + self.metadata_filter_rows_title, self.metadata_filter_rows + ) else: data = pn.Column(self.metadata_filter_rows)