From 4c5a2ae88d026c942f5cf0a7cf3d5916ef6101b8 Mon Sep 17 00:00:00 2001 From: Brian Wylie Date: Sun, 10 Nov 2024 14:05:24 -0700 Subject: [PATCH] ignore any errors when dropping the _aws_url column --- src/sageworks/web_views/artifacts_web_view.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/sageworks/web_views/artifacts_web_view.py b/src/sageworks/web_views/artifacts_web_view.py index 72accde48..9fcf441ab 100644 --- a/src/sageworks/web_views/artifacts_web_view.py +++ b/src/sageworks/web_views/artifacts_web_view.py @@ -41,7 +41,7 @@ def incoming_data_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: s3_data_df["Name"] = hyperlinked_names # Drop the AWS URL column and return the dataframe - s3_data_df.drop(columns=["_aws_url"], inplace=True) + s3_data_df.drop(columns=["_aws_url"], inplace=True, errors="ignore") return s3_data_df def glue_jobs_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: @@ -72,7 +72,7 @@ def glue_jobs_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: glue_df["Name"] = hyperlinked_names # Drop the AWS URL column and return the dataframe - glue_df.drop(columns=["_aws_url"], inplace=True) + glue_df.drop(columns=["_aws_url"], inplace=True, errors="ignore") return glue_df def data_sources_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: @@ -103,7 +103,7 @@ def data_sources_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: data_df["Name"] = hyperlinked_names # Drop the AWS URL column and return the dataframe - data_df.drop(columns=["_aws_url"], inplace=True) + data_df.drop(columns=["_aws_url"], inplace=True, errors="ignore") return data_df def feature_sets_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: @@ -134,7 +134,7 @@ def feature_sets_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: feature_df["Feature Group"] = hyperlinked_names # Drop the AWS URL column and return the dataframe - feature_df.drop(columns=["_aws_url"], inplace=True) + feature_df.drop(columns=["_aws_url"], inplace=True, errors="ignore") return feature_df def models_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: @@ -159,6 +159,9 @@ def models_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: if add_hyperlinks: model_df["Model Group"] = model_df["Model Group"].map(lambda x: self.hyperlinks(x, "models", "")) + # Drop the AWS URL column + model_df.drop(columns=["_aws_url"], inplace=True, errors="ignore") + # Add Health Symbols to the Model Group Name if "Health" in model_df.columns: model_df["Health"] = model_df["Health"].map(lambda x: tag_symbols(x)) @@ -187,6 +190,9 @@ def endpoints_summary(self, add_hyperlinks: bool = True) -> pd.DataFrame: if add_hyperlinks: endpoint_df["Name"] = endpoint_df["Name"].map(lambda x: self.hyperlinks(x, "endpoints", "")) + # Drop the AWS URL column + endpoint_df.drop(columns=["_aws_url"], inplace=True, errors="ignore") + # Add Health Symbols to the Endpoint Name if "Health" in endpoint_df.columns: endpoint_df["Health"] = endpoint_df["Health"].map(lambda x: tag_symbols(x))