Skip to content

Commit

Permalink
pandas: do not load if lib is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Denisov committed Nov 21, 2023
1 parent fe4077b commit 2f9eb7f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions redash/utils/pandas.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import logging
from importlib.util import find_spec

import numpy as np
import pandas as pd

from redash.query_runner import (
TYPE_BOOLEAN,
TYPE_DATE,
Expand All @@ -17,6 +14,10 @@

pandas_installed = find_spec("pandas") and find_spec("numpy")

if pandas_installed:
import numpy as np
import pandas as pd


def get_column_types_from_dataframe(df: pd.DataFrame) -> list:
columns = []
Expand Down

0 comments on commit 2f9eb7f

Please sign in to comment.