How to run a Checkpoint in python

This article is for comments to: https://docs.greatexpectations.io/en/latest/how_to_guides/validation/how_to_run_a_checkpoint_in_python.html

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 "run_staging.chk.py", 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