How to run a Checkpoint in python

This article is for comments to:

Please comment +1 if this How to is important to you.

on Windows I get an error when generating the python script this way.

  File "", line 31
    context = DataContext("C:\***\***\***\ge_example\great_expectations")
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

i resolved by changing the line 31 from:

context = DataContext("C:\***\ge_example\great_expectations")

to adding the r:

context = DataContext(r"C:\***\ge_example\great_expectations")

this is because without the r windows thinks that the letter after \ is a special character.
Should be a easy fix.

1 Like

The example is incorrect.
for batch in checkpoint["batches"]:

It should be
for batch in checkpoint.batches

@nok Would you like to create a PR with the fix? Thank you!

sure, but I want to make sure this is not a bug.

As the old version of ge did use the dictionary key style to access.

In latest version, the legacy batch API requires to use the dot to access instead.

I feel we should fix the LegacyBatchAPI instead of changing the doc here?