This message was deleted.
# hamilton-help
s
This message was deleted.
w
This works:
This doesnt:
s
@Walber Moreira what’s the last line of the stacktrace?
w
Copy code
ShapeError: could not create a new DataFrame: series "full" has length 1561990 while series "removed" has length 84846
For some reason, its trying to do a pl.DataFrame on both outputs
s
what do you want result to be? A dict with two keys? or?
w
Exactly what is shown on the dag, 3 diferent dataframe.
s
yep — what is the adapter that you’re creating?
w
the bultin polars
s
yep. So — what that is doing is trying to “reduce” all the outputs you specified, into a single polars dataframe.
so if you just change things to this:
Copy code
from hamilton import base
hamilton_driver = driver.Driver(config, wind_ml.h_functions, adapter=base.DefaultAdapter())
result
will now be a dictionary with what you expect.
So the TL;DR: is, the output type of
execute()
can be changed based on the adapter you provide.
w
Hmm ok. But why would it reduce into one if I used the extract fields decorator to get the values from the dict?
s
But why would it reduce into one
that’s a function of the adapter provided. So if you provide a “polars dataframe result” one, it’ll try to reduce all the outputs into one dataframe.
w
So I can't ask more than 1 result of the same type?
Because this also fails
s
Yep — did you try running it with:
Copy code
from hamilton import base
hamilton_driver = driver.Driver(config, wind_ml.h_functions, adapter=base.DefaultAdapter())
base.DefaultAdapter()
here “reduces” results into a dictionary.