Skip to content

Commit 339caee

Browse files
committed
Bootstrap AST validators in ValidatorRegistry.get_instance()
The query-language REGISTRY snapshots ValidatorRegistry.get_instance() at import time. This happens during engine bootstrap before bootstrap_ast_validators() populates the singleton, resulting in an empty REGISTRY and KeyError in DruidQueryTransformer on UDF queries. Call bootstrap_ast_validators() in get_instance() when creating the singleton, matching the pattern used by smite's ValidatorRegistry. The import is deferred to avoid circular imports with plugin_manager.
1 parent 4bf4d75 commit 339caee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

osprey_worker/src/osprey/engine/ast_validator/validator_registry.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ def get_instance(cls) -> 'ValidatorRegistry':
1616
tests, you can create your own validator registry, to only run a subset of validations."""
1717
if cls._instance is None:
1818
cls._instance = ValidatorRegistry()
19+
from osprey.worker.adaptor.plugin_manager import bootstrap_ast_validators
20+
21+
bootstrap_ast_validators()
1922

2023
return cls._instance
2124

0 commit comments

Comments
 (0)