Aggregatbezogene Expectations festlegen
Zeit, ein paar spaltenspezifische Expectations auf Aggregat-Ebene zu schreiben. Die Expectation Suite und der Batch sind bereits den Variablen suite bzw. batch zugewiesen und mit dem Shein-Footwear-Datensatz geladen. Great Expectations und pandas stehen als gx bzw. pd zur Verfügung.
Diese Übung ist Teil des Kurses
Einführung in Data Quality mit Great Expectations
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# "colour" should be in the set "Khaki", "Purple", or "Grey"
colour_expectation = gx.expectations.ExpectColumnDistinctValuesToBeInSet(
____="colour", value_set={"Khaki", "Purple", "Grey"}
)
# "seller_name" should have 7 to 10 distinct values
seller_expectation = gx.expectations.ExpectColumnUniqueValueCountToBeBetween(
column="seller_name", ____=7, ____=10
)
# "link" should have all unique values
link_expectation = gx.expectations.____(
column="link"
)
# "review_count" should have a most common value in the set "0" or "100+"
review_count_expectation = gx.expectations.ExpectColumnMostCommonValueToBeInSet(
column=____, value_set=____
)