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
Fix unmatched param bug #162
Conversation
codecov actually deleted their python uploader from pypi, I'll put in a separate PR to fix that in CI |
can you add an example to the PR of what the code would look like that isn't working? Specifically the query multiple version you mentioned? |
Sure, here's a minimum example: param = {
"val": 1,
}
sql = (
"select 1",
"select ?val?"
)
val1, val2 = commands.query_multiple(sql, models=(dict, dict), param=param) This results in this exception:
Here's a more realistic example as well (closer to what I was doing): param = {
"id": 1,
}
sql = (
"select * from table",
"select * from another_table where id = ?id?"
)
val1, val2 = commands.query_multiple(sql, models=(dict, dict), param=param) |
hey man - sorry I'm taking so long getting back to this, been a crazy few months for me. Lets try to get this merged this week. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 569 569
Branches 98 98
=========================================
Hits 569 569
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
No worries, thanks for reviewing! |
Hi! I ran into a bug when using pydapper on my project when parameters are specified, but not used in the SQL query. In that case, it would throw a missing key exception. This might seem like a contrived situation, but it is an issue when using query_multiple where not all queries have parameters specified (which is what happened to me).
I also noticed the
codecov
package version in use is no longer available and was causing the install to fail so I updated it.