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

Improve errors when calling methods without keyword params #39

Closed
mcfunley opened this issue Aug 25, 2020 · 2 comments
Closed

Improve errors when calling methods without keyword params #39

mcfunley opened this issue Aug 25, 2020 · 2 comments
Labels
good first issue Good for newcomers

Comments

@mcfunley
Copy link
Owner

See discussion in issue: #38

When calling a query method as:

queries.foo(1, 2)

Rather than:

queries.foo(a=1, b=2)

You get an unhelpful error. Ideally the exception text would tell you to use kwargs.

@mcfunley mcfunley added the good first issue Good for newcomers label Aug 25, 2020
@Yeganloo
Copy link

Is it good idea to catch the exception and raise a new one with new message?
I am not good with try cache as they effect on performance, specially not on the data-layer!
Can pugsql compiler detect if the queries are using keys or positional arguments?
Of-course it make compiler more complex but this way it is possible to use python typing system and prevent this kind of problems, beside no overhead in runtime will be added!

@mcfunley
Copy link
Owner Author

Fixed here 9c36a10

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

No branches or pull requests

2 participants