2

I am trying to use Great Expectations (Python data quality framework). I ran the quickstart after installing GX on WSL2 and Python 3.9.16

The quickstart code can be found here: https://docs.greatexpectations.io/docs/tutorials/quickstart/

I am getting an error at the last statement:

context.convert_to_file_context()

AttributeError: 'FileDataContext' object has no attribute 'convert_to_file_context'

What am I doing wrong?

BuahahaXD
  • 609
  • 2
  • 8
  • 24

2 Answers2

2

When you run the demo for first time the context = gx.get_context() creates EphemeralDataContext that has the method convert_to_file_context().

Note the great_expectations/ folder that has been created.


When you run the demo next time context = gx.get_context() creates FileDataContext that doesn't have this method.

You can add a check for the type to the code, for example:

from great_expectations.data_context.data_context import EphemeralDataContext

# ...

if isinstance(context, EphemeralDataContext):
    context.convert_to_file_context()
Andrej Kesely
  • 168,389
  • 15
  • 48
  • 91
0

This should be fixed when you upgrade to the latest version of GX - 0.16.5

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 10 '23 at 20:02