Closed AnbazhaganEXL closed 2 months ago
Hi, @AnbazhaganEXL.
Thanks for your feedback.
This may be due to dialect conversion failure of tsql, I will try to reproduce it and fix it.
Hello @longxiaofei ,
Yes your correct, I've handled the same using the sqlglot transpile option for converting the sql. could you please review the below solutions. it works fine after making the change (data_parsers\database_parser.py) .
Function Name : def _format_sql(self, sql: str) -> str:
try:
sql = ast.sql(sqlglot_dialect_name)
except Exception as e:
sql = sqlglot.transpile(str(ast), read='duckdb', write=sqlglot_dialect_name)[0]
@AnbazhaganEXL
Maybe we can solve this bug from the root cause, https://github.com/Kanaries/pygwalker/pull/632.
I've fixed it.
Can you submit a PR about tsql in sqlglot_dialect_map?
Thanks in advance for your contribution.
I've submitted the PR - https://github.com/AnbazhaganEXL/pygwalker/pull/1
Hi @AnbazhaganEXL , You can continue to submit a PR to kanaries/pygwalker
, I will review and merge it.
Sure, will do that.
Describe the bug While trying to use the Microsoft SQL server as backend dataset to connect since we have large set of data needs to be used. We are getting the error "ValueError: Unknown dialect 'mssql'. Did you mean mysql?"
To Reproduce Steps to reproduce the behavior:
Add the mssql+pyodbc connection to reproduce the issue
Expected behavior since the mssql+pyodbc works with SQLAlchemy , not sure why it's not working.
Screenshots If applicable, add screenshots to help explain your problem.
Versions
Additional context I tried to fix the issue by modifying the code in DatabaseDataParser (data_parsers\database_parser.py) class by adding the mssql mapping.
after that change the above code Unknown dialect 'mssql' issue went away and page also loading with list of columns, but when we drag and drop the any coulum for aggregation we are getting the error "str' object has no attribute 'args'"
{"code": -1, "data": {"queryList": [{"workflow": [{"type": "transform", "transform": [{"key": "gw_count_fid", "expression": {"op": "one", "params": [], "as": "gw_count_fid"}}]}, {"type": "view", "query": [{"op": "aggregate", "groupBy": [], "measures": [{"field": "gw_count_fid", "agg": "sum", "asFieldKey": "gw_count_fid_sum"}]}]}], "limit": 50000}]}, "message": "'str' object has no attribute 'args'"}