Skip to content

Commit 171343d

Browse files
Update Changelog, temporarily remove Case Sensitivity testing (#174)
* Update changelog * Fix typo in CHANGELOG * Attempt to fix integration test case sensitivity for redshift * Always lower on Redshift * Fix indentation * Fix whitespace * Fix whitespace pt 2 * Update case sensitive seeds into folder * Use + for quote_columns config * Lower schema on redshift * Use target.type * Do some nonsense to make this work for Redshift * Move seeds config to properties.yml * Bypass redshift completely * Temporarily bypass Redshift in CI completely * Turn Redshift CI back on * Delete case sensitivity test * Delete case sensitive seed * Delete properties.yml for case sensitive seeds
1 parent 1bbc984 commit 171343d

6 files changed

Lines changed: 100 additions & 81 deletions

File tree

CHANGELOG.md

Lines changed: 94 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
## New features
2-
- `generate_model_yaml` with `upstream_descriptions=True` now reads from upstream sources in addition to models.
1+
# dbt-codegen v0.12.0-b1
2+
3+
## What's Changed
4+
5+
### Features
6+
7+
- `generate_model_yaml` with `upstream_descriptions=True` now reads from upstream sources in addition to models.(#112)[https://github.com/dbt-labs/dbt-codegen/issues/112]
8+
- `generate_source` now has options for case sensitivity in all fields ([#112](https://github.com/dbt-labs/dbt-codegen/issues/112)
9+
10+
### Fixes
311

4-
## Fixes
512
- Column `description` fields are now correctly escaped in `generate_model_yaml` ([#142](https://github.com/dbt-labs/dbt-codegen/issues/142))
6-
- Fix `generate_source` behavior of applying a lowercase function to all object names ([#112](https://github.com/dbt-labs/dbt-codegen/issues/112))
13+
14+
### Docs
15+
16+
- Fixed `generate_source` documentation
17+
- Rewrote the contributor README at `integration_tests/README.md`
18+
19+
## New Contributors
20+
21+
- @wircho made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/159
22+
- @yatsky made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/164
23+
- @pnadolny made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/168
24+
- @esegal made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/154
25+
- @gwenwindflower made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/163
26+
27+
**Full Changelog**: https://github.com/dbt-labs/dbt-codegen/compare/0.11.0...0.12.0-b1
28+
29+
## New features
730

831
# dbt-codegen v0.11.0
932

@@ -13,50 +36,56 @@
1336
and are lowercase to align with the dbt style guide. Scale & precision are **not** included. Previous logic for `generate_source` defaulted to `false` and the resulting data types were uppercase and included scale & precision ([#122](https://github.com/dbt-labs/dbt-codegen/pull/122)).
1437

1538
[Dispatch](https://docs.getdbt.com/reference/dbt-jinja-functions/dispatch) can be used to utilize the column data type formatting of previous versions. Namely, by adding this macro to your project:
39+
1640
```sql
1741
{% macro default__data_type_format_source(column) %}
1842
{{ return(column.data_type | upper) }}
1943
{% endmacro %}
2044
```
2145

2246
And then adding this within `dbt_project.yml`:
47+
2348
```yaml
2449
dispatch:
2550
- macro_namespace: codegen
26-
search_order: ['my_project', 'codegen']
51+
search_order: ["my_project", "codegen"]
2752
```
2853
2954
## What's Changed
30-
* GitHub Action to add/remove triage labels as-needed by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/133
31-
* GitHub Action to close issues as stale as-needed by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/134
32-
* Update README.md by @cohms in https://github.com/dbt-labs/dbt-codegen/pull/129
33-
* Remove hard-coded values for database and schema by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/139
34-
* Instructions for the release process by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/137
35-
* Add `include_data_types` argument to `generate_model_yaml` macro by @linbug in https://github.com/dbt-labs/dbt-codegen/pull/122
55+
56+
- GitHub Action to add/remove triage labels as-needed by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/133
57+
- GitHub Action to close issues as stale as-needed by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/134
58+
- Update README.md by @cohms in https://github.com/dbt-labs/dbt-codegen/pull/129
59+
- Remove hard-coded values for database and schema by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/139
60+
- Instructions for the release process by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/137
61+
- Add `include_data_types` argument to `generate_model_yaml` macro by @linbug in https://github.com/dbt-labs/dbt-codegen/pull/122
3662

3763
## New Contributors
38-
* @cohms made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/129
39-
* @linbug made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/122
64+
65+
- @cohms made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/129
66+
- @linbug made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/122
4067

4168
**Full Changelog**: https://github.com/dbt-labs/dbt-codegen/compare/0.10.0...v0.10.0
4269

4370
# dbt-codegen v0.10.0
4471

4572
## What's Changed
46-
* added comments to verbose regex in generate_model_import_ctes by @graciegoheen in https://github.com/dbt-labs/dbt-codegen/pull/93
47-
* Feature/hackathon model generator by @fivetran-joemarkiewicz in https://github.com/dbt-labs/dbt-codegen/pull/83
48-
* Suggestion to include packages.yml example in README.md by @Maayan-s in https://github.com/dbt-labs/dbt-codegen/pull/77
49-
* Add include_data_types flag to generate_source macro by @GSokol in https://github.com/dbt-labs/dbt-codegen/pull/76
50-
* Expected result of nested struct in BigQuery by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/105
51-
* issue106/get_models helper macro by @erkanncelen in https://github.com/dbt-labs/dbt-codegen/pull/115
52-
* Feat/generate sources add database and schema by @jeremyholtzman in https://github.com/dbt-labs/dbt-codegen/pull/124
73+
74+
- added comments to verbose regex in generate_model_import_ctes by @graciegoheen in https://github.com/dbt-labs/dbt-codegen/pull/93
75+
- Feature/hackathon model generator by @fivetran-joemarkiewicz in https://github.com/dbt-labs/dbt-codegen/pull/83
76+
- Suggestion to include packages.yml example in README.md by @Maayan-s in https://github.com/dbt-labs/dbt-codegen/pull/77
77+
- Add include_data_types flag to generate_source macro by @GSokol in https://github.com/dbt-labs/dbt-codegen/pull/76
78+
- Expected result of nested struct in BigQuery by @dbeatty10 in https://github.com/dbt-labs/dbt-codegen/pull/105
79+
- issue106/get_models helper macro by @erkanncelen in https://github.com/dbt-labs/dbt-codegen/pull/115
80+
- Feat/generate sources add database and schema by @jeremyholtzman in https://github.com/dbt-labs/dbt-codegen/pull/124
5381

5482
## New Contributors
55-
* @fivetran-joemarkiewicz made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/83
56-
* @Maayan-s made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/77
57-
* @GSokol made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/76
58-
* @erkanncelen made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/115
59-
* @jeremyholtzman made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/124
83+
84+
- @fivetran-joemarkiewicz made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/83
85+
- @Maayan-s made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/77
86+
- @GSokol made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/76
87+
- @erkanncelen made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/115
88+
- @jeremyholtzman made their first contribution in https://github.com/dbt-labs/dbt-codegen/pull/124
6089

6190
**Full Changelog**: https://github.com/dbt-labs/dbt-codegen/compare/0.9.0...0.10.0
6291

@@ -67,30 +96,40 @@ dispatch:
6796
# dbt-codegen v0.8.0
6897

6998
# Unreleased
99+
70100
## Breaking changes
101+
71102
## New features
103+
72104
## Quality of life
105+
73106
- Now uses `print` instead of `log` to output the generated text into the console. This enables you to invoke dbt with the `--quiet` flag and directly pipe the codegen output into a new file, ending up with valid yaml
74107

75108
## Under the hood
109+
76110
## Contributors:
111+
77112
- [@JorgenG](https://github.com/JorgenG) (#86)
78113

79114
# dbt-codegen v0.7.0
80115

81116
## 🚨 Breaking change
117+
82118
- Add support for including description placeholders for the source and table, which changes the behavior of `generate_source` when `include_descriptions` is set to `True`. Previous logic only created description placeholders for the columns ([#64](https://github.com/dbt-labs/dbt-codegen/issues/64), [#66](https://github.com/dbt-labs/dbt-codegen/pull/66))
83119

84120
## New features
121+
85122
- Add optional `table_names` arg to `generate_source` ([#50](https://github.com/dbt-labs/dbt-codegen/issues/50), [#51](https://github.com/dbt-labs/dbt-codegen/pull/51))
86123
- Add support for importing descriptions from columns with the same names in upstream models. It is available by setting the parameter `upstream_descriptions` to `True` in `generate_model_yaml` ([#61](https://github.com/dbt-labs/dbt-codegen/pull/61))
87124
- Added `case_sensitive_cols` argument to `generate_base_model` macro ([#63](https://github.com/dbt-labs/dbt-codegen/pull/63))
88125
- Add optional `name` arg to `generate_source` ([#64](https://github.com/dbt-labs/dbt-codegen/issues/64), [#66](https://github.com/dbt-labs/dbt-codegen/pull/66))
89126

90127
## Fixes
128+
91129
- `generate_model_yaml` now correctly handles nested `STRUCT` fields in BigQuery ([#27](https://github.com/dbt-labs/dbt-codegen/issues/27), [#54](https://github.com/dbt-labs/dbt-codegen/pull/54))
92130

93131
## Contributors:
132+
94133
- [@rahulj51](https://github.com/rahulj51) (#51)
95134
- [@bodschut](https://github.com/bodschut) (#54)
96135
- [@b-per](https://github.com/b-per) (#61)
@@ -102,94 +141,117 @@ dispatch:
102141
This release creates breaking changes to the `generate_source.sql` macro.
103142

104143
## Features
144+
105145
- add optional `table_pattern` argument to `generate_source.sql` macro. Default value is '%' to pull all tables in the raw data schema to preserve existing behavior if the `table_pattern` argument is not specified by the user.
106146

107147
# dbt-codegen v0.5.0
108148

109149
This release supports any version (minor and patch) of v1, which means far less need for compatibility releases in the future.
110150

111151
## Under the hood
152+
112153
- Change `require-dbt-version` to `[">=1.0.0", "<2.0.0"]`
113154
- Bump dbt-utils dependency
114155
- Replace `source-paths` and `data-paths` with `model-paths` and `seed-paths` respectively
115156
- Rename `data` and `analysis` directories to `seeds` and `analyses` respectively
116157
- Replace `dbt_modules` with `dbt_packages` in `clean-targets`
117158

118159
# dbt-codegen v0.4.1
160+
119161
🚨 This is a compatibility release in preparation for `dbt-core` v1.0.0 (🎉). Projects using this version with `dbt-core` v1.0.x can expect to see a deprecation warning. This will be resolved in the next minor release.
120162

121163
# dbt-codegen v0.4.0
122164

123165
## Breaking changes
166+
124167
- Requires `dbt>=0.20.0` and `dbt-utils>=0.7.0`
125168
- Depends on `dbt-labs/dbt_utils` (instead of `fishtown-analytics/dbt_utils`)
126169

127170
## Features
171+
128172
- Add optional `leading_commas` arg to `generate_base_model` (#41 @jaypeedevlin)
129173
- Add optional `include_descriptions` arg to `generate_source` (#40 @djbelknapdbs)
130174

131175
## Fixes
176+
132177
- In the `generate_source` macro, use `dbt_utils.get_relations_by_pattern` instead of `get_relations_by_prefix`, since the latter will be deprecated in the future (#42)
133178

134179
## Under the hood
180+
135181
- Use new adapter.dispatch syntax (#44)
136182

137183
# dbt-codegen v0.3.2
138184

139185
This is a quality of life release
140186

141187
## Other
142-
* Fix rendering issues on hub.getdbt.com
143-
* Fix integration tests due to python version compatibility
188+
189+
- Fix rendering issues on hub.getdbt.com
190+
- Fix integration tests due to python version compatibility
144191

145192
# dbt-codegen v0.3.1
193+
146194
This is a bugfix release
147195

148196
## Fixes
197+
149198
- Use latest version of dbt-utils (0.6.2) to ensure generate_source_yaml works for non-target schemata (#34)
150199

151200
# dbt-codegen v0.3.0
152-
## 🚨 Breaking change
201+
202+
## 🚨 Breaking change
203+
153204
This release requires dbt v0.18.0, and dbt-utils v0.6.1. If you're not ready to upgrade, consider using a previous release of this package.
154205

155206
## Quality of life
207+
156208
- Use dbt v0.18.0 (#31)
157-
- Fix README rendering on hub (#32 @calvingiles)
209+
- Fix README rendering on hub (#32 @calvingiles)
158210

159211
# dbt-codegen v0.2.0
212+
160213
## 🚨 Breaking change
214+
161215
The lower bound of `dbt-utils` is now `0.4.0`.
162216

163217
This won't affect most users, since you're likely already using version of dbt-utils higher than this to achieve 0.17.0 compatibility.
164218

165219
## Quality of life:
220+
166221
- Change dbt-utils dependencies to `[>=0.4.0, <0.6.0]` (#29)
167222
- Fix tests (#29)
168223

169224
# dbt-codegen v0.1.0
225+
170226
## 🚨 Breaking change!
171227

172228
This package now requires dbt v0.17.x!
173229

174230
## Features:
175-
* Add `generate_model_yaml` (#18 @jtalmi)
176231

232+
- Add `generate_model_yaml` (#18 @jtalmi)
177233

178234
## Under the hood:
179-
* Update to v0.17.0, including `dbt_project.yml` version 2 syntax (#23)
180-
* Add GitHub templates and installation instructions (#23)
235+
236+
- Update to v0.17.0, including `dbt_project.yml` version 2 syntax (#23)
237+
- Add GitHub templates and installation instructions (#23)
181238

182239
## Acknowledgements
240+
183241
@marzaccaro made a PR for `generate_model_yaml`, and, although I had reviewed it, I let the PR go stale and somehow completely forgot about it when merging PR #18 — this is completely my bad! So equal credit to @marzaccaro and @jtalmi for their work :clap:
184242

185243
# dbt-codegen v0.0.4
244+
186245
This is a bugfix release to improve compatibility with Snowflake
187246

188247
# dbt-codegen v0.0.3
248+
189249
Bump utils version range
190250

191251
# dbt-codegen v0.0.2
252+
192253
Small quality of life improvements
193254

194255
# dbt-codegen v0.0.1
256+
195257
Initial release

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ which you can then paste into a schema file.
7070
- `include_schema` (optional, default=False): Whether you want to add
7171
the schema to your source definition
7272
- `case_sensitive_databases` (optional, default=False): Whether you want database names to be
73-
in lowercase, or to match the case in the source table
73+
in lowercase, or to match the case in the source table — not compatible with Redshift
7474
- `case_sensitive_schemas` (optional, default=False): Whether you want schema names to be
75-
in lowercase, or to match the case in the source table
75+
in lowercase, or to match the case in the source table — not compatible with Redshift
7676
- `case_sensitive_tables` (optional, default=False): Whether you want table names to be
77-
in lowercase, or to match the case in the source table
77+
in lowercase, or to match the case in the source table — not compatible with Redshift
7878
- `case_sensitive_cols` (optional, default=False): Whether you want column names to be
79-
in lowercase, or to match the case in the source table
80-
79+
in lowercase, or to match the case in the source table
8180

8281
### Outputting to a file
8382

integration_tests/dbt_project.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ clean-targets:
1818
seeds:
1919
+schema: raw_data
2020
+quote_columns: false
21-
codegen_integration_tests:
22-
data__Case_Sensitive:
23-
+schema: Raw_Data_Case_Sensitive
24-
quote_columns: true
21+
2522
vars:
2623
my_table_reference: table_c
2724

2825
models:
2926
+bind: false
30-

integration_tests/seeds/data__Case_Sensitive.csv

Lines changed: 0 additions & 3 deletions
This file was deleted.

integration_tests/tests/test_generate_source_case_sensitive.sql

Lines changed: 0 additions & 35 deletions
This file was deleted.

macros/generate_source.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% macro get_tables_in_schema(schema_name, database_name=target.database, table_pattern='%', exclude='') %}
2-
2+
33
{% set tables=dbt_utils.get_relations_by_pattern(
44
schema_pattern=schema_name,
55
database=database_name,

0 commit comments

Comments
 (0)