This message was deleted.
# hamilton-help
s
This message was deleted.
e
So the spine_column is done at the end to join the series. Are you just using a single dataframe? Or joining multiple in the results builder?
a
i m joining multiple dataframes
But my output is a single dataframe
e
Got it
So you’re joining as part of your transforms, not the results builder.
I think you can pass any valid series name from the final result although I’d have to dig in to be 100% sure
a
yes
okay i see
e
E.G. the join is going to be a no-op for you
it might be that you want to return that column as well — I can look after I fix the typing piece 🙂 Testing as we speak…
a
okay cool thank youu !!
e
Yeah! So took a quick look — at the end we just join it based on the output — its pretty simple:
Copy code
def build_result(
        self, **outputs: typing.Dict[str, typing.Any]
    ) -> typing.Union[pd.DataFrame, ps.DataFrame]:
        # we don't use the actual function for building right now, we use this hacky equivalent
        df = ps.DataFrame(outputs[self.spine_column])
        for k, v in outputs.items():
            <http://logger.info|logger.info>(f"Got column {k}, with type [{type(v)}].")
            df[k] = v
        if isinstance(self.result_builder, base.PandasDataFrameResult):
            return df.to_pandas()
        else:
            return df
So, the spine has to be a specific column that’s returned
Its possible that it’ll break with a dataframe result — I’ll need to test it ou. D.G. df[k] = v appears to be expecting a series.
s
@Anwar Brini yeah it’s possible this way of building a result isn’t what you want.
e
Yeah — @Stefan Krawczyk has a point. You have no need for the joins if you’re operating on DFs as opposed to columns…
s
if you let us know logically what you want to happen — we can help adjust/augment the code.
at the very least give you a custom adapter that does what you want.
a
I’m currently doing join/transformation operations in the module and some transformations to the final dataframe that i want as an output. I ve tried using the index column of this dataframe as a spine column but it didin’t work and even with extract_columns in the last function that didin’t seem to work either
s
do you have time to jump on a call now? might be easier to see some code/chat live?
a
yeah ofc
s
@Anwar Brini the branch now has the fix for the parameter definition. When you get a chance could you validate please? 🙂