Slackbot
10/27/2022, 4:00 PMElijah Ben Izzy
10/27/2022, 4:10 PMdef with_inputs(input_df: pd.DataFrame, value_a: int, value_b: str) -> pd.Series:
...
Then you can run it like this:
driver.execute(
['with_inputs'],
inputs={
'value_a' : 1,
'value_b' : 'foo',
'input_df' : pd.DataFrame(...)})
If you want it to be a dict of values rather than a few specific ones, you could also pass in/declare a dict (but IMO specific values are more optimal here).Zouhair Mahboubi
10/27/2022, 4:14 PMinput_df
to say some def output_column(input_column_inside_input_df: pd.Series)
or would I have to do something like extract_columns
to expose the columns in input_df
to the DAG?Stefan Krawczyk
10/27/2022, 4:29 PM<http://df.to|df.to>_dict('series')
I think will do the trick for you. — it will return a dict of { col_name -> series} that you can then pass in as input.Elijah Ben Izzy
10/27/2022, 4:30 PMZouhair Mahboubi
10/27/2022, 5:08 PMStefan Krawczyk
10/27/2022, 5:09 PM