Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Created August 23, 2023 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahbenizzy/c242ff65442d7584bfaaa07447da5b6f to your computer and use it in GitHub Desktop.
Save elijahbenizzy/c242ff65442d7584bfaaa07447da5b6f to your computer and use it in GitHub Desktop.
from hamilton.plugins.h_spark import with_columns
import pyspark.sql as ps
import map_transforms # file defined above
@with_columns(
map_transforms,
columns_to_pass=["column_1_from_dataframe", "column_2_from_dataframe"]
)
def final_result(all_initial_data: ps.DataFrame) -> ps.DataFrame:
"""Gives the final result. This decorator will apply the transformations in the order specified in the DAG.
Then, the final_result function is called, with the result of the transformations passed in."""
return _process(all_initial_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment