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

dsc allows sql keywords #229

Open
pcarbo opened this issue Oct 14, 2022 · 2 comments
Open

dsc allows sql keywords #229

pcarbo opened this issue Oct 14, 2022 · 2 comments
Labels

Comments

@pcarbo
Copy link
Member

pcarbo commented Oct 14, 2022

dsc <- dscquery("dsc_result",
                c("fit.update", "evaluate"))
# Calling: dsc-query dsc_result -o /tmp/Rtmpb7j76A/file1ea9366fe952.csv 
#  --target "fit.update evaluate" --force
# INFO: Loading database ...
# INFO: Running queries ...
ERROR: (sqlite3.OperationalError) near "update": syntax error
# [SQL: SELECT "simulate".DSC_REPLICATE AS simulate_DSC_FIELD_DSC_REPLICATE,
#  "fit".update AS fit_DSC_FIELD_update, "evaluate_train".__output__ AS
# evaluate_train_DSC_OUTPUT_ FROM "evaluate_train" INNER JOIN "fit" ON
# "evaluate_train".__parent__ = "fit".__id__ INNER JOIN "simulate" ON "fit".__parent__ 
# = "simulate".__id__]
# (Background on this error at: https://sqlalche.me/e/14/e3q8)
@pcarbo pcarbo added the bug label Oct 14, 2022
@pcarbo
Copy link
Member Author

pcarbo commented Oct 14, 2022

This is what @gaow said:

I suspect it's because dsc-query relies on SQL and update is an SQL keyword.

I did have a list of keywords to block off:
https://github.com/stephenslab/dsc/blob/master/src/query_engine.py#L31
What's weird is that the parser should catch this and not let Yunqi use this keyword as parameter in the first place.

@pcarbo
Copy link
Member Author

pcarbo commented Oct 14, 2022

Also from @gaow:

Ahh actually i tried to fix this problem here. By somehow modify the keywords a bit. But apparently this failed to catch the problem.

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

No branches or pull requests

1 participant