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

Bug: limited portability due to generated SQL strings in data_filter_example #41

Closed
anadon opened this issue Feb 23, 2019 · 2 comments
Closed

Comments

@anadon
Copy link

anadon commented Feb 23, 2019

In the data_filter_example, there is an issue which affects portability between different implementations of SQL. In particular, strings can be single quoted, others double quoted, or either depending upon the implementation. There should be a flag to control which kind of quotation is used.

@tsandall
Copy link
Member

This can be fixed by modifying the sql() function here: https://github.com/open-policy-agent/contrib/blob/master/data_filter_example/data_filter_example/sql.py#L79

Currently the code JSON serializes constant values so strings get written out with double quotes. Perhaps we could could just special case unicode and str types to print with single quotes.

@tsandall
Copy link
Member

Fixed by #46

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

No branches or pull requests

2 participants