fix github action test for chart creation
@@ -90,10 +90,20 @@ def test_score_hist_output_json(spark, gamma_settings_4, params_4, sqlite_con_4)
test chart exported as dictionary is in fact a valid dictionary
"""
+ altair_installed = True
+ try:
+ import altair as alt
+ except ImportError:
+ altair_installed = False
+
dfpd = pd.read_sql("select * from df", sqlite_con_4)
df = spark.createDataFrame(dfpd)
df = df.withColumn("tf_adjusted_match_prob", 1.0 - (f.rand() / 10))
res3 = _calc_probability_density(df, spark=spark, buckets=5)
+
+ if (altair_installed):
assert isinstance(_create_probability_density_plot(res3).to_dict(), dict)
+ else:
+ assert isinstance(_create_probability_density_plot(res3), dict)
