great_expectations icon indicating copy to clipboard operation
great_expectations copied to clipboard

expect_column_values_to_of_type does not work

Open syrineMH opened this issue 1 year ago • 3 comments

Describe the bug I am trying to use expect_column_values_to_be_of_type to verify the type of my datasource (from big query tables) using this expectation from the gallery .https://greatexpectations.io/expectations/expect_column_values_to_be_of_type

my syntaxe     {
      "expectation_type": "expect_column_values_to_be_of_type",
      "kwargs": {
        "column": "date_debut",
        "type_": "DATE",
	"mostly": 1.0
      },
      "meta": {}
    },

I tried with different type but always got the same error below

expect_column_values_to_be_of_type raised an exception:
'type'[Show exception traceback...](https://ofr-bdf-lab-great-expect-prd.ey.r.appspot.com/validations/etask_otomate_189_expectation/20220722-115505-etask-otomate-189/20220722T115505.005936Z/03fd1fdc4deef8a2a0d630010f56b127.html#section-6-content-block-2-cell-1-2-content-2-collapse-body-0297dd0d-f50c-4184-acb4-6bcf350923e9)
Traceback (most recent call last):
File "C:\Applications\Python\venv\lib\site-packages\great_expectations\validator\validator.py", line 979, in graph_validate
result = configuration.metrics_validate(
File "C:\Applications\Python\venv\lib\site-packages\great_expectations\core\expectation_configuration.py", line 1371, in metrics_validate
return expectation_impl(self).metrics_validate(
File "C:\Applications\Python\venv\lib\site-packages\great_expectations\expectations\expectation.py", line 706, in metrics_validate
] = self._validate(
File "C:\Applications\Python\venv\lib\site-packages\great_expectations\expectations\core\expect_column_values_to_be_of_type.py", line 522, in _validate
actual_column_type = [
File "C:\Applications\Python\venv\lib\site-packages\great_expectations\expectations\core\expect_column_values_to_be_of_type.py", line 523, in
type_dict["type"]
KeyError: 'type'

Expected behavior I expect it to verify the type of my column

Environment (please complete the following information):

  • Operating System: [Windows]
  • Great Expectations Version: [0.15.9]

syrineMH avatar Jul 22 '22 13:07 syrineMH

While exmaninated the column_values_to_be_of_type metric on the the folder site-packages\great_expectations\expectations\metrics i didn't see any definition of def _sqlalchemy(cls, column, _dialect, **kwargs could this be the problem ? image

syrineMH avatar Jul 25 '22 07:07 syrineMH

Howdy @syrineMH 👋 thanks for raising this with us 🙇

We'll bring this up with the team. We may need to reach back out if we need anything further in doing so. Thank you very much 🔬

AFineDayFor avatar Jul 28 '22 15:07 AFineDayFor

The same issue is with the expect_column_values_to_be_in_type_list expectations version 0.15.26

serg-music avatar Oct 11 '22 16:10 serg-music

same issue with redshift+psycopg2

tooptoop4 avatar Nov 04 '22 00:11 tooptoop4