diff --git a/cassandra/cluster.py b/cassandra/cluster.py index 1181c6f686..db9eedf212 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -3482,6 +3482,11 @@ def wait_for_schema_agreement(self, wait_time: Optional[float] = None, if wait_time is not None and wait_time <= 0: raise ValueError("wait_time must be greater than 0") + if scope not in (SchemaAgreementScope.RACK, SchemaAgreementScope.DC, SchemaAgreementScope.CLUSTER): + raise ValueError( + "scope must be SchemaAgreementScope.RACK, .DC, or .CLUSTER" + ) + total_timeout = wait_time if wait_time is not None else self.cluster.max_schema_agreement_wait if total_timeout <= 0: raise ValueError("total_timeout must be greater than 0")