Hi, I'm starting to use hamilton and have been lov...
# hamilton-help
a
Hi, I'm starting to use hamilton and have been loving it so far. I tried making a function that returns a tuple:
Copy code
def get_range() -> (int, int): return (1, 3)
And when I ran my pipeline it duplicated the data into 2 rows:
Copy code
other_column get_range
Some Text    1
Some Text    3
But I wanted just one row:
Copy code
other_column get_range
Some Text    (1, 3)
Is there any way to do that, or am I designing my pipeline wrong?
👀 1
s
@Alan Morgan how are you constructing the driver?
and do you want a dataframe as output, or a dictionary?
a
Just very basic:
Copy code
dr = driver.Driver({}, demo)
df = dr.execute(dr.list_available_variables(), inputs={})
print(df)
I'd rather a dictionary be the output.
But it is a dataframe
s
yep — that explains the behavior. Try:
Copy code
dr = (
 driver.Builder()
   .with_config({})
   .with_modules(demo)
   .build()
)
a
Ah, okay, I see the doc saying builder defaults to dict type.
s
This defaults to making the driver return a dictionary when
.execute()
is called.
a
thanks.
gratitude thank you 1