Skip to content

Dummy

Dummy transformation for testing purposes.

koheesio.spark.transformations.dummy.DummyTransformation #

Dummy transformation for testing purposes.

This transformation adds a new column hello to the DataFrame with the value world.

It is intended for testing purposes or for use in examples or reference documentation.

Example

input_df:

id
1
output_df = DummyTransformation().transform(input_df)

output_df:

id hello
1 world

In this example, the hello column is added to the DataFrame input_df.

execute #

execute()
Source code in src/koheesio/spark/transformations/dummy.py
def execute(self):
    self.output.df = self.df.withColumn("hello", lit("world"))