Great_expectations: Calculated expectations

Created on 10 Mar 2021  路  4Comments  路  Source: great-expectations/great_expectations

I wish to add simple row/column calculations to expectations.

To run expectations along the lines of:

batch.expect_column_values_to_equal('installationfee'==(('unit_price'*'license_years')-'arr'))

expectation-request help wanted

All 4 comments

@JerryJohn95 This is a good way to express a lot more tests using Expectation. I would probably rephrase it as: expect_column_values_to_be_computed_from_other_columns(column="installationfee", column_expression="'unit_price'*'license_years')-'arr'")

@jcampbell Thoughts?

That's a great idea, @eugmandel -- I think that would make for a great additional expectation! I suspect it would be a great case study for someone interested in building a new expectation via the contrib package.

@JerryJohn95 This guide will walk you through the process of developing and contributing a new Expectation: https://docs.greatexpectations.io/en/latest/guides/how_to_guides/creating_and_editing_expectations/how_to_contribute_a_new_expectation_to_great_expectations.html

Reach out for help in our Slack if needed.

Was this page helpful?
0 / 5 - 0 ratings