Slackbot
02/16/2023, 12:59 PMElijah Ben Izzy
02/16/2023, 2:15 PMStefan Krawczyk
02/16/2023, 4:56 PMdf.to_dict(orient="series")
Is a quick one liner that does the conversion.
Our apprehension to do going it automatically is just around what is most obvious as to what is happening if someone was to come read the code after you wrote it.JVial
02/17/2023, 11:49 AMJVial
02/17/2023, 4:52 PMmy_dataframe = result_df.to_dict(orient="series")
hamilton_driver = driver.Driver(my_dataframe, module)
output = hamilton_driver.execute(output_columns)
and the transformation-script (at the moment really minimalistic)
def business_travel(my_dataframe: pd.DataFrame) -> pd.DataFrame:
<http://logger.info|logger.info>("Start with Transformation")
return my_dataframe
Stefan Krawczyk
02/17/2023, 5:17 PMbusiness_travel
function expects an input named “my_dataframe” that is of type DataFrame. You’re currently passing in a dict of series that doesn’t map to that expectation. So one way you can do it is like so:
hamilton_driver = driver.Driver({}, module)
output = hamilton_driver.execute(output_columns, inputs={"my_dataframe": result_df)