Load and parse the manifest.json file using dbt-artifacts-parser. Raises: FileNotFoundError: If manifest.json doesn't exist ValueError: If manifest.json is invalid JSON ImportError: If dbt-artifacts-parser is not installed
(self)
| 80 | self._parsed_manifest: Optional[Any] = None |
| 81 | |
| 82 | def parse(self) -> None: |
| 83 | """ |
| 84 | Load and parse the manifest.json file using dbt-artifacts-parser. |
| 85 | |
| 86 | Raises: |
| 87 | FileNotFoundError: If manifest.json doesn't exist |
| 88 | ValueError: If manifest.json is invalid JSON |
| 89 | ImportError: If dbt-artifacts-parser is not installed |
| 90 | """ |
| 91 | if not self.manifest_path.exists(): |
| 92 | raise FileNotFoundError( |
| 93 | f"dbt manifest not found at {self.manifest_path}.\n" |
| 94 | f"Run 'dbt compile' or 'dbt run' first.\n" |
| 95 | f"Expected path: <dbt_project>/target/manifest.json" |
| 96 | ) |
| 97 | |
| 98 | try: |
| 99 | with open(self.manifest_path, "r") as f: |
| 100 | self._raw_manifest = json.load(f) |
| 101 | except json.JSONDecodeError as e: |
| 102 | raise ValueError( |
| 103 | f"Invalid JSON in manifest: {e}\nTry: dbt clean && dbt compile" |
| 104 | ) |
| 105 | |
| 106 | # Parse using dbt-artifacts-parser for typed access |
| 107 | try: |
| 108 | from dbt_artifacts_parser.parser import parse_manifest |
| 109 | |
| 110 | assert self._raw_manifest is not None |
| 111 | self._parsed_manifest = parse_manifest(manifest=self._raw_manifest) |
| 112 | except ImportError: |
| 113 | raise ImportError( |
| 114 | "dbt-artifacts-parser is required for dbt integration.\n" |
| 115 | "Install with: pip install 'feast[dbt]' or pip install dbt-artifacts-parser" |
| 116 | ) |
| 117 | |
| 118 | def _extract_column_from_node(self, col_name: str, col_data: Any) -> DbtColumn: |
| 119 | """Extract column info from a parsed node column.""" |