Rubén Lopez Lozoya
07/12/2021, 10:36 AMTypeError: Argument 'obj' has incorrect type (expected list, got frozenlist)
This is what my config looks like:
solid_uw_get_target_metrics_columns = configured(
solid_get_target_df_columns, name="solid_uw_get_target_metrics_columns"
)({"columns": ["field", "source", "value", "reliability"]})
And this is what the solid looks like:
@solid(
config_schema={
"columns": Field([str], is_required=True),
}
)
def solid_get_target_df_columns(context, dfs: Dict[str, DagsterDataFrame]):
"""Solid that returns a Dictionary where every DataFrame has the columns specified from the original DataFrame
Parameters:
---------
dfs : Dict[str, DagsterDataFrame]
Dictionary containing DagsterDataFrames to retrieve columns from
columns : List[str]
List of target columns
Returns:
-------
dfs: Dict[str, DagsterDataFrame]
Dictionary containing DagsterDataFrames with target columns
"""
processed_dfs = {}
for key, df in dfs.items():
processed_dfs[key] = df[context.solid_config["columns"]]
return processed_dfs
If I cast to list(context.solid_config["columns"])
it works, otherwise the error will keep appearing. Any ideas?alex
07/12/2021, 3:56 PMlist
is the right thing to do for now, but consider voicing your opinion on https://github.com/dagster-io/dagster/issues/3008