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

CombineFirst class/method #4524

Closed
jc-harrison opened this issue Nov 12, 2021 · 0 comments · Fixed by #4525
Closed

CombineFirst class/method #4524

jc-harrison opened this issue Nov 12, 2021 · 0 comments · Fixed by #4525
Labels
enhancement New feature or request FlowMachine Issues related to FlowMachine

Comments

@jc-harrison
Copy link
Member

We would like to be able to combine the outputs of two subscriber location queries, such that a subscriber's location is assigned from the first query if they appear in that query result, or the second query otherwise (i.e. SELECT subscriber, COALESCE(location_from_first_query, location_from_second_query)).

I'd suggest a useful way to implement this would be to add a new query class that takes two queries, joins on specified join_columns, and coalesces values in specified combine_columns. This is somewhat similar to the pandas.DataFrame.combine_first method, and I propose to name it accordingly.

We could also add a Query.combine_first method to wrap this class (along the lines of the existing join, subset, union methods).

@jc-harrison jc-harrison added enhancement New feature or request FlowMachine Issues related to FlowMachine P-Now labels Nov 12, 2021
@jc-harrison jc-harrison mentioned this issue Nov 12, 2021
8 tasks
@mergify mergify bot closed this as completed in #4525 Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request FlowMachine Issues related to FlowMachine
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant