-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include data_type
in the output of generate_model_yaml
#120
Comments
@dbeatty10 would something like this be suitable? My concern now is that all tests that invoke this macro will need to include logic for all target types, since they use different data type names (e.g. |
That PR is looking good @linbug ! Absolutely agreed that the testing part looks cumbersome. #76 ran into something similar. We discussed and tried a couple options before settling on an approach. There are a few options for your PR:
Want to take a look at these options and let me know what you think? You won't hear me say this too often, but I might be comfortable with skipping tests in this case if it has the least downsides of the options. |
Always-on vs. optionalIn the original issue description, it said:
It is easy enough to just add a new Thought processFor users, this would preserve optionality while still putting forward default behavior we're assuming would be best for the greatest number of users.
|
Thanks @dbeatty10 for the quick and detailed responses! For the testing, I had a look through that previous PR that you linked. I think that adopting the same approach (using How does that sound? I'm aligned on adding a |
Something else I just noticed is that in |
@linbug Your proposals for the testing sound good -- let's do it as you proposed. For the common
It's fine if the changes related to Since there will be changes to how The current version of dbt_codegen is 0.9.0, and we'll make sure to bump the next version to 0.10.0 (or maybe even 1.0.0!) so these changes don't break anything for folks that have the 0.9.x series as an upper bound. |
@dbeatty10 I've made those changes now, and signed the CLA. The PR is ready for review. |
Describe the feature
When generating output, codegen should have an option to include
data_type
like the following:Furthermore, this option should probably default to
true
. It possibly shouldn't even be optional, but just always be included in the generated output.See here for more context: https://github.com/dbt-labs/internal-analytics/pull/1418#discussion_r1144991800
Describe alternatives you've considered
An alternative is to copy-paste
data_type
by hand into the YAML. These would be copied from aninformation_schema.columns
query or show columns, etc.Additional context
Side note to spin out into a separate issue: reconciling greenfield YAML from codegen with pre-existing YAML is annoying / time-consuming. Can we write some kind of guidance on easier ways to reconcile two YAML files?
Who will this benefit?
With the launch of data contracts in the dbt-core 1.5.0 release, it's handy to automatically generate the relevant
data_types
for pre-existing models.Are you interested in contributing this feature?
Happy to review the PR if someone else wants to take this on.
The text was updated successfully, but these errors were encountered: