You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2024/05/15 21:49:19 UTC

(superset) branch elizabeth/tune-logging created (now eb36e279c6)

This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a change to branch elizabeth/tune-logging
in repository https://gitbox.apache.org/repos/asf/superset.git


      at eb36e279c6 warning emits an error

This branch includes the following new commits:

     new eb36e279c6 warning emits an error

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: warning emits an error

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch elizabeth/tune-logging
in repository https://gitbox.apache.org/repos/asf/superset.git

commit eb36e279c6600c458cb8f0a3d7d41b1a6404912d
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Wed May 15 14:49:06 2024 -0700

    warning emits an error
---
 superset/utils/pandas_postprocessing/compare.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/superset/utils/pandas_postprocessing/compare.py b/superset/utils/pandas_postprocessing/compare.py
index b20682027f..96d4335e52 100644
--- a/superset/utils/pandas_postprocessing/compare.py
+++ b/superset/utils/pandas_postprocessing/compare.py
@@ -19,12 +19,17 @@ from typing import Optional
 import pandas as pd
 from flask_babel import gettext as _
 from pandas import DataFrame
+from pandas.errors import PerformanceWarning
 
 from superset.constants import PandasPostprocessingCompare
 from superset.exceptions import InvalidPostProcessingError
 from superset.utils.core import TIME_COMPARISON
 from superset.utils.pandas_postprocessing.utils import validate_column_args
 
+import logging
+
+logger = logging.getLogger(__name__)
+
 
 @validate_column_args("source_columns", "compare_columns")
 def compare(  # pylint: disable=too-many-arguments
@@ -81,5 +86,8 @@ def compare(  # pylint: disable=too-many-arguments
         df = pd.concat([df, diff_df], axis=1)
 
     if drop_original_columns:
-        df = df.drop(source_columns + compare_columns, axis=1)
+        try:
+            df = df.drop(source_columns + compare_columns, axis=1)
+        except PerformanceWarning as ex:
+            logger.warning(ex)
     return df