-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
columns
schema redundancy for external sources
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from unittest.mock import MagicMock | ||
|
||
from dbt_dry_run.models.manifest import ExternalConfig, ManifestColumn, Node, NodeConfig | ||
from dbt_dry_run.node_runner.source_runner import SourceRunner | ||
from dbt_dry_run.results import DryRunStatus, Results | ||
|
||
|
||
def test_external_source_with_columns_but_no_dry_run_columns() -> None: | ||
# Create a Node with an external source that has columns but no dry_run_columns | ||
node = Node( | ||
unique_id="S", | ||
resource_type="source", | ||
config=NodeConfig(), | ||
name="s", | ||
database="db1", | ||
schema="schema1", | ||
original_file_path="/filepath1.yaml", | ||
root_path="/filepath1", | ||
columns={ | ||
"column1": ManifestColumn(name="column1", data_type="STRING"), | ||
"column2": ManifestColumn(name="column2", data_type="RECORD[]"), | ||
}, | ||
alias="s", | ||
external=ExternalConfig(location="location"), # No dry_run_columns specified | ||
) | ||
|
||
mock_sql_runner = MagicMock() | ||
mock_results = MagicMock() | ||
|
||
source_runner = SourceRunner(mock_sql_runner, mock_results) | ||
result = source_runner.run(node) | ||
|
||
# The test should pass if no InvalidColumnSpecification exception is raised | ||
assert result.status != DryRunStatus.FAILURE |