I frequently find myself using the following patte...
# ask-community
d
I frequently find myself using the following pattern when collecting outputs of a dynamic fan
Copy code
@op
def join_data_and_add_calculated_columns(dataframes:List[CustomDataFrameType1])->CustomDataFrameType2:
    if not dataframes:
        return pd.DataFrame()
    full_df = pd.concat(dataframes)
Before I started using custom types created by
create_dagster_pandas_dataframe_type
this was no problem. Now its an issues because
return pd.DataFrame()
does not pass validation. What's the recommended behaviour when you don't have inputs and want to return an empty dataframe?
i
The type Dagster.Type.Nothing can help, I think
p
Do you rely on the fact that it is an empty dataframe in your downstream ops? I wonder if you might be able to conditionally return
None
by making the datatype Optional