Skip to content

Commit 4f1e527

Browse files
committed
add boxplot in plot list as well
1 parent c035cbd commit 4f1e527

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pandasai/ee/agents/semantic_agent/pipeline/code_generator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def execute(self, input_data: Any, **kwargs) -> Any:
8686
def _get_type(self, input: dict) -> bool:
8787
return (
8888
"plot"
89-
if input["type"] in ["bar", "line", "histogram", "pie", "scatter"]
89+
if input["type"]
90+
in ["bar", "line", "histogram", "pie", "scatter", "boxplot"]
9091
else input["type"]
9192
)
9293

tests/unit_tests/ee/semantic_agent/test__semantic_code_generator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,10 @@ def test_generate_matplolib_boxplot_chart_code(
307307

308308
logic_unit = code_gen.execute(json_str, context=context, logger=logger)
309309
assert isinstance(logic_unit, LogicUnitOutput)
310-
print(logic_unit.output)
311310
assert (
312311
logic_unit.output
313312
== """
314-
313+
import matplotlib.pyplot as plt
315314
import pandas as pd
316315
317316
sql_query="SELECT `orders`.`ship_country` AS ship_country, SUM(`orders`.`freight`) AS total_freight FROM `orders` GROUP BY ship_country"

0 commit comments

Comments
 (0)