probcomp/bayeslite

pass query parameters through to metamodel syntax

Open

#446 geöffnet am 12. Juli 2016

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (63 Forks)batch import
help wantedk days

Repository-Metriken

Stars
 (915 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Currently we do not distinguish

CREATE GENERATOR g FOR p USING m ("foo")

from

CREATE GENERATOR g FOR p USING m ('foo')

which is not at the moment blocking anything (hence the stall of #410), but which may be worth fixing soon. Furthermore, passing a verbatim string through, e.g. to provide the source code in

CREATE GENERATOR g FOR p USING cgpm (
    MODEL x GIVEN y USING venturescript (source = 'assume x = 42; ...')
)

as we kludgily do in https://github.com/probcomp/bayeslite/blob/f3f27a584286a4f3f3a415a7935da6ea78bd9824/tests/test_vscgpm.py#L166-L179 with Python string formatting, is not easy to do reliably. That fragment just assumes no " appears in the VentureScript code, and abuses "..." quotation, which in SQL means names, with '...' meaning strings. No quotation should be necessary on the user's part -- it should be possible to do

bdb.execute('CREATE GENERATOR ... USING venturescript (source = ?) ...', (venturescript,))

and get the same intended effect reliably.

Contributor Guide