Tworzenie Expectations na poziomie agregacji
Czas poćwiczyć pisanie Expectations dla konkretnych kolumn na poziomie agregacji. Expectation Suite i Batch zostały już przypisane do zmiennych suite i batch, a zbiór danych Shein Footwear jest wczytany. Great Expectations i pandas są dostępne odpowiednio jako gx i pd.
To ćwiczenie jest częścią kursu
Wprowadzenie do jakości danych z Great Expectations
Interaktywne ćwiczenie praktyczne
Spróbuj tego ćwiczenia, uzupełniając ten przykładowy kod.
# "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=____
)