Skip to content

Commit

Permalink
fix(expression): modulo operation issues (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaliseraoul authored Feb 26, 2025
1 parent 3cb04f1 commit 3197476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pandasai/data_loader/sql_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def execute_query(self, query: str, params: Optional[list] = None) -> pd.DataFra
"The SQL query is deemed unsafe and will not be executed."
)
try:
if params:
query = query.replace(" % ", " %% ")
return load_function(connection_info, query, params)

except ModuleNotFoundError as e:
Expand Down
2 changes: 2 additions & 0 deletions pandasai/data_loader/view_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def execute_query(self, query: str, params: Optional[list] = None) -> pd.DataFra
"The SQL query is deemed unsafe and will not be executed."
)
try:
if params:
query = query.replace(" % ", " %% ")
return load_function(connection_info, query, params)

except ModuleNotFoundError as e:
Expand Down

0 comments on commit 3197476

Please sign in to comment.