KKo
Contributor III

@Joseph Kambourakis​  I found a way to achieve this. using the function

def union_all(dfs):

 if len(dfs) > 1:

  return dfs[0].unionByName(union_all(dfs[1:]), allowMissingColumns=True)

 else:

  return dfs[0]

View solution in original post