0

I tried to run this code using PyCharm:

import great_expectations as ge
df=ge.read_csv(r"C:\Users\TasbeehJ\data\yellow_tripdata_2019-01.csv")
print(df.expect_column_values_to_be_in_set('passenger_count',[1,2,3,4,5]))

conf=df.get_expectation_suite()

df.save_expectations_config(r"C:\Users\TasbeehJ\data\yellow_tripdata_2019-01.data.expectations.json")

but it gave me this error:

AttributeError: 'PandasDataset' object has no attribute 'save_expectations_config'

how can I save the config if not using that??

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Tasbeeh
  • 45
  • 4
  • What makes you think `save_expectations_config` should exist…? – deceze Mar 30 '22 at 12:23
  • I watched this, they used it and it worked! https://www.youtube.com/watch?v=-_0tG7ACNU4 – Tasbeeh Mar 31 '22 at 13:12
  • It's entirely possible the library has been refactored in those intervening 4 years. Try basing your code on the current documentation first… – deceze Mar 31 '22 at 13:39

1 Answers1

2

The save_expectations_config has been refactored to save_expectation_suite.

Haq Nawaz
  • 61
  • 2