Skip to content

Commit

Permalink
narrow condition for Float64 sanitization in Altair (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorisjlee committed Feb 20, 2021
1 parent dfa64eb commit c4229a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lux/vislib/altair/AltairChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def initialize_chart(self):
@classmethod
def sanitize_dataframe(self, df):
for attr in df.columns:
if pd.api.types.is_float_dtype(df[attr].dtype): # Check if dtype is unrecognized by Altair
# Check if dtype is unrecognized by Altair (#247)
if str(df[attr].dtype) == "Float64":
df[attr] = df[attr].astype(np.float64)

# Altair can not visualize non-string columns
Expand Down

0 comments on commit c4229a0

Please sign in to comment.