Page MenuHomePhabricator

Update run functions to accept a filepath as well as a string for the SQL command
Open, MediumPublic

Description

Currently, all of wmfdata's run functions require the SQL command to be passed as a string, but in many cases it's preferable to store the SQL query in a separate file (possibly for syntax highlighting). We should make it possible to pass the path to such a file too.

Event Timeline

nshahquinn-wmf created this task.
nshahquinn-wmf moved this task from Triage to Backlog on the Product-Analytics board.
nshahquinn-wmf raised the priority of this task from Low to Medium.Dec 22 2021, 3:04 AM
nshahquinn-wmf added a subscriber: Mayakp.wiki.

I happened to ask @Mayakp.wiki what new features she would find useful in Wmfdata-Python. One thing she mentioned was a way to get syntax highlighting on queries to be run with Wmfdata-Python.

Also, when I suggested that we could do that by supporting running queries stored in a separate file, we also got to talking about the benefits of parameterizing queries at runtime (e.g. using f-strings). If we do this, it would be useful to add a mechanism to pass parameters that would be applied to the file before running.