Skip to content

Fix unknown_member macro boolean type inference with explicit casts#29

Merged
jonhopper-dataengineers merged 1 commit into
mainfrom
feature/unknown_member_boolean_cast
May 21, 2026
Merged

Fix unknown_member macro boolean type inference with explicit casts#29
jonhopper-dataengineers merged 1 commit into
mainfrom
feature/unknown_member_boolean_cast

Conversation

@jonhopper-dataengineers

@jonhopper-dataengineers jonhopper-dataengineers commented May 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Added explicit ::boolean casts to is_current, is_deleted, and generic boolean columns in the unknown_member macro to fix Snowflake type inference issues when generating unknown member rows.
  • Bumped version from 1.0.3 to 1.0.4 and updated CHANGELOG.

Test plan

  • Run dbt compile to verify the macro generates valid SQL with the ::boolean casts
  • Run integration tests against a model using unknown_member with boolean columns
  • Verify the generated unknown member row has correct BOOLEAN column types in Snowflake

.... Generated with Cortex Code

Summary by Sourcery

Ensure unknown_member macro correctly handles boolean columns in Snowflake and bump package version.

Bug Fixes:

  • Correct unknown_member macro boolean column defaults by adding explicit BOOLEAN casts to avoid Snowflake type inference issues.

Enhancements:

  • Update project version metadata from 1.0.3 to 1.0.4 to reflect the boolean casting fix.

Tests:

  • Add integration package lock configuration for testing the local dbt_dataengineers_utils package.

@sourcery-ai

sourcery-ai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds explicit ::boolean casts in the unknown_member macro’s boolean outputs to fix Snowflake type inference for generated unknown member rows, bumps the package version to 1.0.4, and adds an integration test package-lock for local package resolution along with documenting the fix in the changelog.

File-Level Changes

Change Details Files
Ensure unknown_member macro emits explicit BOOLEAN-typed values for Snowflake.
  • Change is_current unknown member column from an untyped true literal to true::boolean.
  • Change is_deleted unknown member column from an untyped false literal to false::boolean.
  • Change generic BOOLEAN column default from true to true::boolean when generating the unknown member row.
macros/modelling/unknown_member.sql
Versioning and metadata updates to reflect the bugfix release and stabilize integration tests.
  • Add v1.0.4 entry to the changelog describing the boolean cast fix and version bump.
  • Bump dbt package version from 1.0.3 to 1.0.4 in dbt_project.yml.
  • Add integration_tests/package-lock.yml to pin the local package and checksum for integration testing.
CHANGELOG.md
dbt_project.yml
integration_tests/package-lock.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Added ::boolean casts to is_current, is_deleted, and generic boolean
columns in the unknown_member macro to ensure Snowflake correctly infers
the column type when generating unknown member rows.

.... Generated with [Cortex Code](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-Authored-By: Cortex Code <noreply@snowflake.com>
@jonhopper-dataengineers jonhopper-dataengineers force-pushed the feature/unknown_member_boolean_cast branch from 8de0d06 to 8a2eeca Compare May 21, 2026 04:19

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jonhopper-dataengineers jonhopper-dataengineers merged commit 1d56973 into main May 21, 2026
2 checks passed
@jonhopper-dataengineers jonhopper-dataengineers deleted the feature/unknown_member_boolean_cast branch May 21, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant