python: factor out join assembly
spark: outer join