Skip to content

Fixed issue 11963 - #12007

Open
mansibrahman03 wants to merge 3 commits into
fivetran:developfrom
mansibrahman03:fix-issue-11963
Open

Fixed issue 11963#12007
mansibrahman03 wants to merge 3 commits into
fivetran:developfrom
mansibrahman03:fix-issue-11963

Conversation

@mansibrahman03

@mansibrahman03 mansibrahman03 commented Jul 27, 2026

Copy link
Copy Markdown

What does this PR do?

This PR adds a new expectation, ExpectColumnTypeToBe, that checks a column's declared data type at the schema level. It works the same way across every backend — pandas, SQL databases, and Spark — and always returns a simple result of just {"observed_value": ""}, with no row-level details. It reuses the existing type-matching logic from ExpectColumnValuesToBeOfType and the table.column_types metric. Unit and integration tests were added to confirm expected behavior. This PR does not change the implementation for ExpectColumnValuesToBeOfType.

Why was this PR needed?

The existing ExpectColumnValuesToBeOfType is inconsistent across different datasets, validating at row-level for some datasets and schema-level for other datasets. Reproducing the issue confirmed this inconsistent behavior. The purpose of this PR is to include a separate ExpectColumnTypeToBe expectation that always does a schema-level check consistently everywhere, while ExpectColumnValuesToBeOfType is intended to eventually do only row-level checks.

Relevant issue number

Closes #11963

Screenshots / Recordings

Unit Tests:
image

Relevant Integration Test:
image

Does this PR meet the acceptance criteria?

  • Tests added for new/changed behavior
  • All tests passing
  • Follows project style guide
  • No breaking changes introduced

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

👷 Deploy request for niobium-lead-7998 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit f939545

@github-actions github-actions Bot added the cla-not-signed https://github.com/fivetran/great_expectations/blob/develop/CLA.md label Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this pull request, every committer needs to have signed our Contributor License Agreement (CLA).

We could not find a signed CLA for: @mansibrahman03. Please sign the Individual Contributor License Agreement, or the Software Grant and Corporate Contributor License Agreement if you are contributing on behalf of your employer (see CLA.md for details).

Once resolved, comment @cla-bot check on this pull request to re-run the check.

@mansibrahman03

Copy link
Copy Markdown
Author

Hi @joshua-stauffer — this is my first contribution to this project. I've fixed issue #11963 by implementing a new expectation, ExpectColumnTypeToBe, that only checks a column's declared data type at the schema level. Would appreciate a review when you have time!

…ations/expectations/core/expect_column_type_to_be.py) and added integration test file (file path: tests/integration/data_sources_and_expectations/expectations/test_expect_column_type_to_be.py). Modified great_expectations/expectations/__init__.py and great_expectations/expectations/core/__init__.py to register new expectation.
…ations/core/test_expect_column_type_to_be.py
@mansibrahman03

Copy link
Copy Markdown
Author

@cla-bot check

@joshua-stauffer

Copy link
Copy Markdown
Collaborator

hey @mansibrahman03, thanks for the PR! Looks like we're missing a CLA signature for you (see docs here). Once you submit the CLA, comment @cla-bot check to re-run verification. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-not-signed https://github.com/fivetran/great_expectations/blob/develop/CLA.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] ExpectColumnTypeToBe

2 participants