mirror of https://github.com/apache/superset.git
chore(prophet): ignore logged warning for missing plotly package (#11334)
* chore(prophet): ignore logged warning for missing plotly package * reset log level after import
This commit is contained in:
parent
a2a614d760
commit
dcf12762b3
|
@ -14,6 +14,7 @@
|
|||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import logging
|
||||
from functools import partial
|
||||
from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Union
|
||||
|
||||
|
@ -590,7 +591,12 @@ def _prophet_fit_and_predict( # pylint: disable=too-many-arguments
|
|||
Fit a prophet model and return a DataFrame with predicted results.
|
||||
"""
|
||||
try:
|
||||
prophet_logger = logging.getLogger("fbprophet.plot")
|
||||
|
||||
prophet_logger.setLevel(logging.CRITICAL)
|
||||
from fbprophet import Prophet # pylint: disable=import-error
|
||||
|
||||
prophet_logger.setLevel(logging.NOTSET)
|
||||
except ModuleNotFoundError:
|
||||
raise QueryObjectValidationError(_("`fbprophet` package not installed"))
|
||||
model = Prophet(
|
||||
|
|
Loading…
Reference in New Issue