-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ct-603 docs generate test conversion (#116)
* Update test_basic with docs_generate test * Implement DocsGenerate and DocsGenReferences tests * Remove existing docs_generate_tests * Fix docs gen references test, and skip
- Loading branch information
Showing
25 changed files
with
144 additions
and
1,985 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
from dbt.tests.util import AnyStringWith, AnyFloat, AnyString | ||
|
||
|
||
def redshift_stats(): | ||
return { | ||
"has_stats": { | ||
"id": "has_stats", | ||
"label": "Has Stats?", | ||
"value": True, | ||
"description": "Indicates whether there are statistics for this table", | ||
"include": False, | ||
}, | ||
"encoded": { | ||
"id": "encoded", | ||
"label": "Encoded", | ||
"value": AnyStringWith("Y"), | ||
"description": "Indicates whether any column in the table has compression encoding defined.", | ||
"include": True, | ||
}, | ||
"diststyle": { | ||
"id": "diststyle", | ||
"label": "Dist Style", | ||
"value": AnyStringWith("AUTO"), | ||
"description": "Distribution style or distribution key column, if key distribution is defined.", | ||
"include": True, | ||
}, | ||
"max_varchar": { | ||
"id": "max_varchar", | ||
"label": "Max Varchar", | ||
"value": AnyFloat(), | ||
"description": "Size of the largest column that uses a VARCHAR data type.", | ||
"include": True, | ||
}, | ||
"size": { | ||
"id": "size", | ||
"label": "Approximate Size", | ||
"value": AnyFloat(), | ||
"description": "Approximate size of the table, calculated from a count of 1MB blocks", | ||
"include": True, | ||
}, | ||
"sortkey1": { | ||
"id": "sortkey1", | ||
"label": "Sort Key 1", | ||
"value": AnyString(), | ||
"description": "First column in the sort key.", | ||
"include": True, | ||
}, | ||
"pct_used": { | ||
"id": "pct_used", | ||
"label": "Disk Utilization", | ||
"value": AnyFloat(), | ||
"description": "Percent of available space that is used by the table.", | ||
"include": True, | ||
}, | ||
"stats_off": { | ||
"id": "stats_off", | ||
"label": "Stats Off", | ||
"value": AnyFloat(), | ||
"description": "Number that indicates how stale the table statistics are; 0 is current, 100 is out of date.", | ||
"include": True, | ||
}, | ||
"rows": { | ||
"id": "rows", | ||
"label": "Approximate Row Count", | ||
"value": AnyFloat(), | ||
"description": "Approximate number of rows in the table. This value includes rows marked for deletion, but not yet vacuumed.", | ||
"include": True, | ||
}, | ||
} | ||
|
||
|
||
def redshift_ephemeral_summary_stats(): | ||
additional = { | ||
"skew_sortkey1": { | ||
"description": "Ratio of the size of the largest non-sort " | ||
"key column to the size of the first column " | ||
"of the sort key.", | ||
"id": "skew_sortkey1", | ||
"include": True, | ||
"label": "Sort Key Skew", | ||
"value": 1.0, | ||
}, | ||
"sortkey_num": { | ||
"description": "Number of columns defined as sort keys.", | ||
"id": "sortkey_num", | ||
"include": True, | ||
"label": "# Sort Keys", | ||
"value": 1.0, | ||
}, | ||
"unsorted": { | ||
"description": "Percent of unsorted rows in the table.", | ||
"id": "unsorted", | ||
"include": True, | ||
"label": "Unsorted %", | ||
"value": 0.0, | ||
}, | ||
} | ||
stats = redshift_stats() | ||
stats.update(additional) | ||
return stats |
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 was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
tests/integration/docs_generate_tests/cross_db_models/model.sql
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
tests/integration/docs_generate_tests/cross_db_models/schema.yml
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
tests/integration/docs_generate_tests/fail_macros/failure.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
tests/integration/docs_generate_tests/models/second_model.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
tests/integration/docs_generate_tests/ref_models/ephemeral_copy.sql
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
tests/integration/docs_generate_tests/ref_models/ephemeral_summary.sql
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.