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

add relabeled_clone to CTEColumn #4

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

pwfff
Copy link

@pwfff pwfff commented Jun 18, 2018

This is probably the worst way to do it, but it works for me. Because the cte.col.column_name has no reference the the cloned query when it's cloned in resolve_expression, I'm just adding this table alias when it happens. It probably won't work if it's nested more than once.

@pwfff
Copy link
Author

pwfff commented Jun 18, 2018

Yeah, this is definitely the wrong approach. I can make it recursive to handle my other failing test cases, but I think the real fix is somehow changing the ._cte reference on the CTEColumn to reference the actual query it's on instead of the original query you used to get the CTEColumn. I'm trying to figure out how to do that now.

@pwfff
Copy link
Author

pwfff commented Jun 18, 2018

Got it 😅
Just needed to add relabeled_clone to CTEColumn.

@millerdev
Copy link
Contributor

This looks good, thanks for following up. Do you mind squashing the changes into a single commit on this PR?

@pwfff
Copy link
Author

pwfff commented Jun 18, 2018

For sure, done.

@pwfff pwfff changed the title add resolve_expression add relabeled_clone to CTEColumn Jun 18, 2018
@millerdev millerdev merged commit 4a3a82a into dimagi:master Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants