mechatroner / vscode_rainbow_csv

🌈Rainbow CSV - VS Code extension: Highlight CSV and TSV files in different rainbow colors to make them more readable
MIT License
426 stars 51 forks source link

RBQL with Python error #148

Closed cbconne closed 9 months ago

cbconne commented 1 year ago

image

As shown in the screenshot. It looks like I don't have Python installed or configured in the system path, but that's not.

mechatroner commented 1 year ago

Thanks for reporting! I think I know what the problem is - the extension tries to run python instead of python3 command - I wrongly assumed that any Python installation would have that alias defined. I will fix it in the next release, meanwhile, you can create python -> python3 symlink and it will probably work.

cbconne commented 1 year ago

Thanks for reporting! I think I know what the problem is - the extension tries to run python instead of python3 command - I wrongly assumed that any Python installation would have that alias defined. I will fix it in the next release, meanwhile, you can create python -> python3 symlink and it will probably work.

Yes, I created a symlink, then it work. But there is still a problem. With JS: image image But with Python: image image No data was found when using the same query statement using Python.

mechatroner commented 1 year ago

RBQL is essentially a thin wrapper around JS or Python interpreter. Also, all CSV field variables in RBQL are strings until you convert them to something else. So in JS you can compare integers and strings and get true e.g. '10051' == 10051, while in Python this doesn't work, so either use select * where int(a1) == 10051 or select * where a1 == '10051'

mechatroner commented 9 months ago

Fixed: starting from version 3.10.0 python3 is used first and if the invocation fails python is used as a fallback.