bugfix: Oracle timegrains fail to render when wrapped in outer query #7767
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CATEGORY
SUMMARY
This bug is slightly related to #7729 , where Oracle is forced to wrap an additional query around the original query. This causes the SQLAlchemy compiler to create a new column object based on the original
TimestampExpression
, which doesn't receive a column (is only supposed to have the label of the original object), and hence is unable to complete the compilation. This is solved by passing aColumnClause
class to the method via the_constructor
property that creates the outer query proxy column, which solves the problem.Before
After
TEST PLAN
Tested locally to work on sqlite (regression testing) and Oracle, with and without time grain.
ADDITIONAL INFORMATION
REVIEWERS
@devilzhangzzz