Bug fixes for views: return views in get_table_options and improve reflection#46
Conversation
|
Since there's little distinction between tables and views, this PR also includes a refactor to reduce duplication of code between table-specific and view-specific methods. |
|
@graingert @bouk @cpcloud Thoughts? |
There was a problem hiding this comment.
The output of pg_get_viewdef includes a semicolon at the end of the query. The SQLAlchemy CreateTable, etc. commands don't include a semicolon at the end of the output, so we need to strip that out somewhere for consistency.
This TRIM(TRAILING ';' is the solution used in psql's \d+ command to get rid of the semicolon.
|
This doesn't change functionality at all right? |
With this change, Both of the previous behaviors I consider bugs. |
|
Can you add tests and changelog for these bugs please? |
|
I'm going to need some help if we're going to try to add tests for these. The current test structure for reflection relies on @graingert - Do you have suggestions about how we can create a view in our test models to reflect from? |
|
One option is to use the
|
|
Test failure is an unexpected 500 from bigcrunch again. |
|
For now you'll have to retry the build after redshift has booted up properly
|
8bfbfea to
ccb1abd
Compare
|
Totally forgot about the changelog. I just pushed an update that adds a note about the changes. |
There was a problem hiding this comment.
this file is auto-generated by zest.releaser do we need this extra new-line?
There was a problem hiding this comment.
The newline as an attempt to make the whitespacing consistent. Other sections in this file are preceeded by two blank lines. It looks like I missed adding an extra blank line beneath the 0.2.1 section while I was at it.
It doesn't matter functionally, so I'll revert the change to avoid noise in the diff.
43e8362 to
ad64806
Compare
|
We're still getting intermittent 500 responses from bigcrunch. How well do you understand the behavior, @graingert? |
|
@jklukas there's a small window between the cluster booting and cluster being available (DNS etc) where these 500s occur. I know how to fix this. Are you able to access the rebuild button on Travis? |
I have limited experience with Travis, so didn't know to look for one. I was just able to trigger a rebuild. We'll see how it does. |
|
This looks great, merging. Thanks very much! |
Bug fixes for views: return views in get_table_options and improve reflection
Because SQLAlchemy only has limited support for views, some methods that include
tablein the name are also supposed to return views.