# How does the expect\_column\_values\_to\_be\_of\_type expectation work?

**URL:** <https://discourse.greatexpectations.io/t/how-does-the-expect-column-values-to-be-of-type-expectation-work/630>\
**Category:** Archive\
**Created:** [February 17, 2021, 3:43am UTC](https://discourse.greatexpectations.io/t/how-does-the-expect-column-values-to-be-of-type-expectation-work/630 "2021-02-17T03:43:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugene.mandel](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.greatexpectations.io/eugene.mandel/32/22_2.png) [@eugene.mandel](https://discourse.greatexpectations.io/u/eugene.mandel)\
**Post date:** [February 17, 2021, 3:43am UTC](https://discourse.greatexpectations.io/t/how-does-the-expect-column-values-to-be-of-type-expectation-work/630/1 "2021-02-17T03:43:19Z")

</div>

This post addresses a question about the [expect\_column\_values\_to\_be\_of\_type](https://docs.greatexpectations.io/en/latest/autoapi/great_expectations/dataset/dataset/index.html#great_expectations.dataset.dataset.Dataset.expect_column_values_to_be_of_type) expectation that was asked by a few users - what type does it validate exactly?

The expectation is about the “storage type” - the type is currently used to store a value. Contrast this with “what the value REALLY is”, let’s call it “semantic type”.

Let’s say that your table in a database has a VARCHAR column, but all the values in that column are unparsed numbers (e.g., “124”). If you use this expectation with type=integer, the validation will fail.

In this case you would need a new expectation, something like expect\_column\_values\_to\_be\_castable\_to\_type. This expectation does not exist in the library. You can implement it for yourself as a custom expectation, or, even better, implement it and contribute it back to the community.
