-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
raise an error when no columns are found #1676
Conversation
The method `create_table` uses the length of the first element of the `columns` property to determine how column names are formatted. Unfortunately this is not exhaustive case coverage. For instance, if a `columns` property is formatted improperly, `create_table` can fail silently, matching neither the first nor the second if clause. In such cases we should alert the user that something has gone awry. To remedy this, here we raise a `ValueError` when neither if clause is met. This both alerts the user to the cause of the problem and halts the application from making erroneous and incorrect progress. If we prefer to make the `CREATE` query optional, we could instead log an error to stderr, however it seems unlikely that we would ever wish to not create our tables.
By analyzing the blame information on this pull request, we identified @dlstadther, @ddaniels888 and @steenzout to be potential reviewers |
By default lgtm |
@Tarrasch Any reason not to merge this? |
Isn't all the tests failing due to indentation error? |
Ah, yes. The |
That also raises the question of how much this was tested (if at all). @maxcountryman, can you also add a motivation to this patch? What real world use case scenario does it solve for you? |
@Tarrasch did you read the commit message...? |
@maxcountryman I did not, sorry! Thanks, it explains it well. I'm too used to GitHub copying it into the PR description. :) |
Ready to merge? |
No description provided.