Skip to content

Commit

Permalink
Add warning in case core config files are found with yaml extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanau7 authored and Sumanau Sareen committed Mar 29, 2020
1 parent 4fe3d88 commit f78d822
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/dbt/parser/schemas.py
Expand Up @@ -31,6 +31,7 @@
validator_error_message, JSONValidationException,
raise_invalid_schema_yml_version, ValidationException, CompilationException
)
from dbt.logger import GLOBAL_LOGGER as logger
from dbt.node_types import NodeType
from dbt.parser.base import SimpleParser
from dbt.parser.search import FileBlock, FilesystemSearcher
Expand Down Expand Up @@ -127,6 +128,19 @@ def resource_type(self) -> NodeType:
return NodeType.Test

def get_paths(self):
# TODO: In order to support this, make FilesystemSearcher accept a list
# of file patterns. eg: ['.yml', '.yaml']
yaml_files = FilesystemSearcher(
self.project, self.project.all_source_paths, '.yaml'
)
if yaml_files:
logger.warning(
f'We have decided that dbt release July 1, 2020 onwards,'
f' will start parsing core config files with `.yaml` extension.'
f' That means that we will continue to support existing `.yml` extension'
f' along with `.yaml` extension. You should make sure these `.yaml` files'
f' are of correct schema or you can choose to remove this files from the project.'
)
return FilesystemSearcher(
self.project, self.project.all_source_paths, '.yml'
)
Expand Down

0 comments on commit f78d822

Please sign in to comment.