C2_W3_Lab2 ungraded lab: reproducing the code sequence of the class


My question is about Lab C2_W3_Lab2_Interactive_schema. Doing my own test, I wanted to reproduce the code sequence of class of W3/Evolving Data/Schema Environments where the instructor applied the schema with the SERVING environment. Since, in the lab, the data has the ‘label’ feature, which is removed from the SERVING env of the schema, I expect it to spit out an anomaly.

Anyway, I realized that the class uses the lower abstraction level using tdfv, while the label uses the higher one using tfx. The practical issue for me is that tfx.components.ExampleValidator does not recognize the ‘environment’ flag. On the other hand, when I want to use the tfdv API (tfdv.validate_statistics), passing to it statistics_gen.outputs[‘statistics’] spits out an issue, as it expects a DatasetFeatureStatisticsList object.

I can inspect statistics_gen.outputs[‘statistics’]._artifacts[0], which displays the URI which contains what I need, but I struggle to load it into the desired DatasetFeatureStatisticsList. Can somebody help me in that regards?

Thank you!

Please click my name and message your notebook as an attachment and a link to your dataset(s).