-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1610 from fishtown-analytics/feature/split-parsed…
…-things Split Parsed and Compiled nodes into subtypes (#1601)
- Loading branch information
Showing
22 changed files
with
445 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
import os | ||
from typing import Dict, Any | ||
|
||
from dbt.contracts.graph.parsed import ParsedAnalysisNode, ParsedRPCNode | ||
from dbt.parser.base_sql import BaseSqlParser | ||
import os | ||
|
||
|
||
class AnalysisParser(BaseSqlParser): | ||
@classmethod | ||
def get_compiled_path(cls, name, relative_path): | ||
return os.path.join('analysis', relative_path) | ||
|
||
def parse_from_dict( | ||
self, | ||
parsed_dict: Dict[str, Any] | ||
) -> ParsedAnalysisNode: | ||
"""Given a dictionary, return the parsed entity for this parser""" | ||
return ParsedAnalysisNode.from_dict(parsed_dict) | ||
|
||
class RPCCallParser(AnalysisParser): | ||
|
||
class RPCCallParser(BaseSqlParser): | ||
def get_compiled_path(cls, name, relative_path): | ||
return os.path.join('rpc', relative_path) | ||
|
||
def parse_from_dict(self, parsed_dict: Dict[str, Any]) -> ParsedRPCNode: | ||
"""Given a dictionary, return the parsed entity for this parser""" | ||
return ParsedRPCNode.from_dict(parsed_dict) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.