@@ -284,7 +284,10 @@ def add_output(self, ref: RefBundle) -> None:
284284 """Move a bundle produced by the operator to its outqueue."""
285285
286286 ref , diverged = dedupe_schemas_with_validation (
287- self ._schema , ref , warn = not self ._warned_on_schema_divergence
287+ self ._schema ,
288+ ref ,
289+ warn = not self ._warned_on_schema_divergence ,
290+ enforce_schemas = self .op .data_context .enforce_schemas ,
288291 )
289292 self ._schema = ref .schema
290293 self ._warned_on_schema_divergence |= diverged
@@ -756,7 +759,7 @@ def dedupe_schemas_with_validation(
756759 old_schema : Optional ["Schema" ],
757760 bundle : "RefBundle" ,
758761 warn : bool = True ,
759- allow_divergent : bool = False ,
762+ enforce_schemas : bool = False ,
760763) -> Tuple ["RefBundle" , bool ]:
761764 """Unify/Dedupe two schemas, warning if warn=True
762765
@@ -765,7 +768,7 @@ def dedupe_schemas_with_validation(
765768 the new schema will be used as the old schema.
766769 bundle: The new `RefBundle` to unify with the old schema.
767770 warn: Raise a warning if the schemas diverge.
768- allow_divergent : If `True`, allow the schemas to diverge and return unified schema.
771+ enforce_schemas : If `True`, allow the schemas to diverge and return unified schema.
769772 If `False`, but keep the old schema.
770773
771774 Returns:
@@ -792,7 +795,7 @@ def dedupe_schemas_with_validation(
792795 f"than the previous one. Previous schema: { old_schema } , "
793796 f"new schema: { bundle .schema } . This may lead to unexpected behavior."
794797 )
795- if allow_divergent :
798+ if enforce_schemas :
796799 old_schema = unify_schemas_with_validation ([old_schema , bundle .schema ])
797800
798801 return (
0 commit comments