-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-1110] [Feature] Cross-database macro for type_boolean()
#5739
Comments
type_boolean()
type_boolean()
Additional context: another community member opened a PR for |
@jaypeedevlin thanks for opening! ReactionAny (or all) of the following are reasonable to include:
@Fleid please feel free to weigh in or contradict me case you have both interest and insight on this!
Implementation hintsWe'd expect any adapter to override these methods as-needed (including raising a not supported exception when appropriate). Not all databases will support all of these types, but they might be able to be "faked" in some fashion (see SQL Server and booleans). Each high-level default implementation will look like this:
Then the low-level default implementation will use dbt-core/core/dbt/adapters/base/column.py Line 11 in 1df713f
For database adapters that need to override the default, it will look like this: "STRING": "STRING", Testing hints
|
@jaypeedevlin related to discussion over in #5778, I'm happy to take the This is one that's grinding on my gears for a lack of support. |
You're welcome to any/all of it, I have some (temporary) code here you're welcome to borrow, although as Doug points out there will need to be changes in each adapter. |
@jpmmcneill very timely of you: #5520 is related to cross db macros for arrays. Background:
I'm in progress of moving those into dbt-core (plus each adapter, like dbt-redshift, etc) Would be glad for any feedback you're able to provide on those implementations! |
@jpmmcneill or @jaypeedevlin do either of you still want to submit a PR for To have a chance to be included in dbt Core 1.3, we'd probably want to have it ready within the next 7 days. General outline for implementation is here. The testing part is always the most time-consuming for me. |
@dbeatty10 👋 I've spun up two PRs for type_boolean. I think the bigquery one is required because of how the inheritence is set up, but am not 100%. dbt-core: #5875 I need to figure out how to get my dbt-core local dev setup for running the data type tests (they're complaining about a module error when I try to pytest them). Depending on how fast local dev will get setup, type array / json might be possible before 1.3. type_boolean is definitely the most simple version of the three! |
Awesome @jpmmcneill ! Continuing the conversation with next steps over at #5875 |
Thanks @jpmmcneill for picking this up and apologies both for my absence, I’ve been dealing with a family emergency. Glad to see this looks like it will sneak in for 1.3 |
Resolved by #5875, et al. Thank you to @jpmmcneill, @jaypeedevlin, @Maayan-s and everyone else who participated in making this feature happen 🙌 |
### Description Adds a test for `type_boolean` macro introduced at dbt-labs/dbt-core#5739, following dbt-labs/dbt-spark#471.
Is this your first time submitting a feature request?
Describe the feature
There are some great type helpers that have migrated from utils to core, but
type_boolean()
is a notable exception. Speaking to @joellabes he indicated that y'all would likely be supportive of adding this one in. I've got a basic implementation in brooklyn-data/dbt_artifacts#188 that I'd be happy to contribute.Describe alternatives you've considered
Not doing it :)
Who will this benefit?
Mostly folks maintaining packages.
Are you interested in contributing this feature?
Certainly!
Anything else?
Not officially included in the scope of this request, but something I'd love input on is a
type_json
andtype_array
, both of which I implemented in the above PR. If y'all were open to this I might expand the scope since I have versions ready to go.The text was updated successfully, but these errors were encountered: