You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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 specifiedcombine_columns
. This is somewhat similar to thepandas.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 existingjoin
,subset
,union
methods).The text was updated successfully, but these errors were encountered: