Um es im kleinen Maßstab zu reproduzieren, erstellen Sie „Test Calendar.csv“:
Code: Select all
Date
1995-01-03
1995-01-04
1995-01-05
Code: Select all
# %%
import great_expectations as gx
import pandas as pd
# %%
# Get the Ephemeral Data Context
context = gx.get_context()
assert type(context).__name__ == "EphemeralDataContext"
# %%
context = gx.get_context()
# %%
df = pd.read_csv("Test Calendar.csv", parse_dates=["Date"])
# %%
pd.to_datetime(df["Date"])
# %%
data_source = context.data_sources.add_pandas("pandas")
data_asset = data_source.add_dataframe_asset(name="pd dataframe asset")
batch_definition = data_asset.add_batch_definition_whole_dataframe("batch definition")
batch = batch_definition.get_batch(batch_parameters={"dataframe": df})
# %%
# Create an Expectation Suite
suite = gx.ExpectationSuite(name="expectation_suite")
# %%
suite.add_expectation(
gx.expectations.ExpectColumnValuesToBeIncreasing(column="Date")
)
# %%
validation_results = batch.validate(suite)
print(validation_results)
Code: Select all
raise gx_exceptions.MetricResolutionError(\ngreat_expectations.exceptions.exceptions.MetricResolutionError: '>=' not supported between instances of 'Timedelta' and 'int'\n",
"exception_message": "'>=' not supported between instances of 'Timedelta' and 'int'",
Dies ist das vollständige Ergebnis
Code: Select all
Calculating Metrics: 30%|██████████████████████████████ | 3/10 [00:00
Mobile version