Slackbot
11/17/2022, 7:59 PMElijah Ben Izzy
11/17/2022, 8:03 PMStefan Krawczyk
11/17/2022, 8:09 PMexecute()
.Stefan Krawczyk
11/17/2022, 8:10 PMZouhair Mahboubi
11/17/2022, 11:57 PMfrom_dict
)
2. if the outputs are a mix of pd.Series and other types (ints, etc.), will the driver automatically fallback to returning dictionaries? i.e. does it concatenate into a df only if everything is a pd.Series, and otherwise returns a dict?Stefan Krawczyk
11/18/2022, 12:12 AMrealized that we’d have to do a bunch of ‘refactoring’ to make that workSearch and replace shouldn’t be hard to place in a bunch of unions? Otherwise you can define a graph adapter to make them equivalent. Let me know if you want code for that. Regarding: (1) If using the default driver and adapter then yes — since the following seems to work.
a = {'a': np.array([1,2,3]), 'b': np.array([3, 4, 5])}
pd.DataFrame(a)
a b
0 1 3
1 2 4
2 3 5
If you want a dictionary of output then you need to pass in adapter to the driver that will do that. Sorry but I see we’re lacking in docs here — but the idea can be seen in https://hamilton-docs.gitbook.io/docs/reference/api-reference/available-drivers and you change step 3 …Stefan Krawczyk
11/18/2022, 12:15 AM