Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OperationalError: malformed MATCH expression #51

Open
egolinko opened this issue Dec 19, 2019 · 3 comments
Open

OperationalError: malformed MATCH expression #51

egolinko opened this issue Dec 19, 2019 · 3 comments

Comments

@egolinko
Copy link

What I'm experiencing is when the term 'NOT' is within the string(s) of columns we are trying to join, I'm getting back 'OperationalError: malformed MATCH expression' . My feeling is because there is a SQL dependency for reserved words, example below ought to show error.

The below code snipped ought to reproduce error.

x1=pd.DataFrame(['xyz NOT', 'YES', '425255'], columns=['X'])
x2=pd.DataFrame(['NOT', 'OK', '42525511'], columns=['X'])

fuzzy_left_join(x1,x2, left_on='X', right_on='X')
@soliverc
Copy link

I had the same problem here:
#47
He said he fixed it but he must have forgotten about 'NOT'.

@SidSaxena
Copy link

SidSaxena commented Aug 30, 2020

He said he fixed it but he must have forgotten about 'NOT'.

I believe you are right. Anywhere the word 'not' is mentioned in my data it gives me an error. I've tried removing those entries one by one and that error for that particular entry goes away. However I still haven't been able to get rid of the error completely yet.

But yeah, seconding this. Still looking for a way around this. Would appreciate some tips.

@michelsantanalpa
Copy link

It's fixed here on GitHub but when you install the package via pip, it seems that takes an older version.
You just have to edit the file fuzzymatcher/data_getter_sqlite.py and in the line 180, add the "NOT" token to escape:
tokens_to_escape = ["AND", "OR", "NEAR", "NOT"]
You can look for the location of the package with the command "pip show fuzzymatcher"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants