ValueError: A schema was provided as an input and the stats_options exec_property also contains a schema value. At most one of these may be set

For C2W3_Assignment, Exercise 8: Statistics with the new schema
I have the following code:

START CODE HERE

Use StatisticsGen to compute the statistics using the curated schema

statistics_gen_updated = StatisticsGen(
examples=example_gen.outputs[‘examples’],
schema=user_schema_importer.outputs[‘result’],
stats_options=stats_options
)

Run the component

context.run(statistics_gen_updated)

END CODE HERE

Not sure why I’m getting this error:

114 if input_dict.get(SCHEMA_KEY):
115 if stats_options.schema:
→ 116 raise ValueError('A schema was provided as an input and the ’
117 'stats_options exec_property also contains a schema ’
118 ‘value. At most one of these may be set.’)

ValueError: A schema was provided as an input and the stats_options exec_property also contains a schema value. At most one of these may be set.

I remmed out this line and everything was OK.

1 Like

Thanks! It worked based on your suggestion

Thanks @qasi. It worked for me as well!