Compare commits

...

2 Commits

Author SHA1 Message Date
MichelleArk
96a70c6778 changelog entry 2025-07-25 14:00:14 -04:00
MichelleArk
bf64d7a539 test module fix 2025-07-25 12:46:52 -04:00
2 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
kind: Under the Hood
body: Lazy import of include.jsonschemas to avoid local ModuleNotFoundError issues
time: 2025-07-25T14:00:05.396192-04:00
custom:
Author: michelleark
Issue: "11862"

View File

@@ -11,7 +11,6 @@ from jsonschema._keywords import type as type_rule
from jsonschema.validators import Draft7Validator, extend
from dbt import deprecations
from dbt.include.jsonschemas import JSONSCHEMAS_PATH
from dbt_common.context import get_invocation_context
_PROJECT_SCHEMA: Optional[Dict[str, Any]] = None
@@ -41,6 +40,8 @@ _HIERARCHICAL_CONFIG_KEYS = {
def load_json_from_package(jsonschema_type: str, filename: str) -> Dict[str, Any]:
"""Loads a JSON file from within a package."""
# Lazy import to avoid ModuleNotFoundError
from dbt.include.jsonschemas import JSONSCHEMAS_PATH
path = Path(JSONSCHEMAS_PATH).joinpath(jsonschema_type, filename)
data = path.read_bytes()