We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ExpectationProfiler fails to profile a datetime column
**Describe the bug**
I've encountered the following `TypeError` when trying to profile a dataframe that has a datetime column
<details><summary>Click to expand <strong><em>Traceback</em></strong></summary>

```python

profile.to_expectation_suite(suite_name=f"{schema}.{table}")
[03/11/21 14:49:33] INFO     INFO - 2021-03-11 14:49:33,088 - utils.py - NumExpr utils.py:157
                             defaulting to 4 threads.                                        
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/ds-vroom-demand/great_expectations/uncommitted/test_profile.py in 
----> 15 profile.to_expectation_suite(suite_name=f"{schema}.{table}")

~/.pyenv/versions/vroom/lib/python3.7/site-packages/pandas_profiling/expectations_report.py in to_expectation_suite(self, suite_name, data_context, save_suite, run_validation, build_data_docs, handler)
     88         # Dispatch to expectations per semantic variable type
     89         for name, variable_summary in summary["variables"].items():
---> 90             handler.handle(variable_summary["type"], name, variable_summary, batch)
     91 
     92         # We don't actually update the suite object on the batch in place, so need

...
~/.pyenv/versions/vroom/lib/python3.7/site-packages/great_expectations/dataset/pandas_dataset.py in is_between(val)
   1223                     ):
   1224                         raise TypeError(
-> 1225                             "Column values, min_value, and max_value must either be None or of the same type."
   1226                         )
   1227 

```
</details>

```python
TypeError: Column values, min_value, and max_value must either be None or of the same type.
```

From looking at the arguments to `is_between` in `great_expectations.dataset.pandas_dataset.py`, this seems to be due to `min_value` and `max_value` being serialised to their string representations, but the column itself doesn't.

I think this can be resolved by modifying the arguments to `datetime_expectations` in `pandas_profiling.model.expectation_algorithms` as follows 

```python
def datetime_expectations(name, summary, batch, *args):
    if any(k in summary for k in ["min", "max"]):
        batch.expect_column_values_to_be_between(
            name, min_value=summary.get("min"), max_value=summary.get("max"), parse_strings_as_datetimes=True
        )

    return name, summary, batch
```
I've been able to resolve this issue myself by altering that function. I'm happy to submit this as a PR if this is acceptable.

**To Reproduce**
```python
"""
Test for issue XXX:
https://github.com/pandas-profiling/pandas-profiling/issues/XXX
"""
import pandas as pd
import pandas_profiling


def test_issueXXX():
    df = pd.DataFrame({'date':pd.date_range('2021-01-01', '2021-03-01', freq='d')})
    profile = pandas_profiling.ProfileReport(df=df, explorative=True)
    profile.to_expectation_suite(suite_name='test',   save_suite=False, build_data_docs=False, run_validation=False)
  
```

**Version information:**

* _Python version_: 3.7.6
* _Environment_: Pycharm
* _`pip`_: 

<details><summary>Click to expand <strong><em>Version information</em></strong></summary>
<p>

```
alembic==1.4.1
altair==4.1.0
appnope==0.1.2
argon2-cffi==20.1.0
arrow==0.17.0
astor==0.8.1
async-generator==1.10
attrs==20.3.0
azure-core==1.11.0
azure-storage-blob==12.7.1
backcall==0.2.0
base58==2.1.0
binaryornot==0.4.4
bleach==3.2.3
blinker==1.4
boto3==1.17.2
botocore==1.20.2
cachetools==4.2.1
category-encoders==2.2.2
certifi==2020.12.5
cffi==1.14.4
chardet==3.0.4
click==7.1.2
cloudpickle==1.6.0
colorama==0.4.4
commonmark==0.9.1
confuse==1.4.0
cookiecutter==1.7.2
cryptography==3.3.1
cycler==0.10.0
dask==2021.2.0
databricks-cli==0.14.1
decorator==4.4.2
defusedxml==0.6.0
distributed==2021.2.0
docker==4.4.2
docutils==0.16
entrypoints==0.3
Faker==6.0.0
fastapi==0.63.0
featuretools==0.23.1
Flask==1.1.2
fsspec==0.8.5
gitdb==4.0.5
GitPython==3.1.12
great-expectations==0.13.8
gunicorn==20.0.4
HeapDict==1.0.1
htmlmin==0.1.12
hypothesis==6.3.4
idna==2.10
ImageHash==4.2.0
importlib-metadata==2.1.1
iniconfig==1.1.1
ipykernel==5.4.3
ipython==7.19.0
ipython-genutils==0.2.0
ipywidgets==7.6.3
isodate==0.6.0
itsdangerous==1.1.0
jedi==0.18.0
Jinja2==2.11.2
jinja2-time==0.2.0
jinjasql==0.1.8
jmespath==0.10.0
joblib==1.0.0
jsonpatch==1.28
jsonpointer==2.0
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.11
jupyter-console==6.2.0
jupyter-core==4.7.0
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.0
kiwisolver==1.3.1
lightgbm==3.1.1
locket==0.2.1
loky==2.9.0
Mako==1.1.4
MarkupSafe==1.1.1
matplotlib==3.3.3
missingno==0.4.2
mistune==0.8.4
mlflow==1.13.1
mock==4.0.3
msgpack==1.0.2
msrest==0.6.21
mypy-extensions==0.4.3
nbclient==0.5.1
nbconvert==6.0.7
nbformat==5.1.2
nest-asyncio==1.5.1
networkx==2.5
nltk==3.5
notebook==6.2.0
numpy==1.19.5
oauthlib==3.1.0
opt-einsum==3.3.0
packaging==20.8
pandas==1.2.1
pandas-profiling==2.11.0
pandera==0.6.2
pandocfilters==1.4.3
parso==0.8.1
partd==1.1.0
patsy==0.5.1
pexpect==4.8.0
phik==0.11.2
pickleshare==0.7.5
Pillow==8.1.0
pluggy==0.13.1
poyo==0.5.0
prometheus-client==0.9.0
prometheus-flask-exporter==0.18.1
prompt-toolkit==3.0.14
protobuf==3.14.0
psutil==5.8.0
psycopg2-binary==2.8.6
ptyprocess==0.7.0
py==1.10.0
pycparser==2.20
pydantic==1.7.3
pydeck==0.5.0
Pygments==2.7.4
pyOpenSSL==20.0.1
pyparsing==2.4.7
PyPika==0.47.4
pyro-api==0.1.2
pyro-ppl==1.5.2
pyrsistent==0.17.3
pytest==6.2.2
python-dateutil==2.8.1
python-dotenv==0.15.0
python-editor==1.0.4
python-slugify==4.0.1
pytz==2020.5
PyWavelets==1.1.1
PyYAML==5.4.1
pyzmq==21.0.2
qtconsole==5.0.2
QtPy==1.9.0
querystring-parser==1.2.4
regex==2020.11.13
requests==2.25.1
requests-oauthlib==1.3.0
rich==9.11.0
rpy2==3.4.2
ruamel.yaml==0.16.12
s3transfer==0.3.4
scikit-learn==0.24.1
scipy==1.6.0
seaborn==0.11.1
Send2Trash==1.5.0
shellingham==1.4.0
six==1.15.0
smart-open==4.2.0
smmap==3.0.5
sortedcontainers==2.3.0
SQLAlchemy==1.3.23
sqlparse==0.4.1
starlette==0.13.6
statsmodels==0.12.2
streamlit==0.77.0
tabulate==0.8.7
tangled-up-in-unicode==0.0.6
tblib==1.7.0
termcolor==1.1.0
terminado==0.9.2
testpath==0.4.4
text-unidecode==1.3
threadpoolctl==2.1.0
toml==0.10.2
toolz==0.11.1
torch==1.7.1
tornado==6.1
tqdm==4.56.0
traitlets==5.0.5
typer==0.3.2
typer-cli==0.0.11
typing-extensions==3.7.4.3
typing-inspect==0.6.0
tzlocal==2.1
urllib3==1.25.11
validators==0.18.2
visions==0.6.0
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==0.57.0
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
zict==2.0.0
zipp==3.4.0
```
</p></summary></details>



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/pandas_profiling/model/expectation_algorithms.py`
Content:
```
1 def generic_expectations(name, summary, batch, *args):
2     batch.expect_column_to_exist(name)
3 
4     if summary["n_missing"] == 0:
5         batch.expect_column_values_to_not_be_null(name)
6 
7     if summary["p_unique"] == 1.0:
8         batch.expect_column_values_to_be_unique(name)
9 
10     return name, summary, batch
11 
12 
13 def numeric_expectations(name, summary, batch, *args):
14     from great_expectations.profile.base import ProfilerTypeMapping
15 
16     numeric_type_names = (
17         ProfilerTypeMapping.INT_TYPE_NAMES + ProfilerTypeMapping.FLOAT_TYPE_NAMES
18     )
19 
20     batch.expect_column_values_to_be_in_type_list(
21         name,
22         numeric_type_names,
23         meta={
24             "notes": {
25                 "format": "markdown",
26                 "content": [
27                     "The column values should be stored in one of these types."
28                 ],
29             }
30         },
31     )
32 
33     if summary["monotonic_increase"]:
34         batch.expect_column_values_to_be_increasing(
35             name, strictly=summary["monotonic_increase_strict"]
36         )
37 
38     if summary["monotonic_decrease"]:
39         batch.expect_column_values_to_be_decreasing(
40             name, strictly=summary["monotonic_decrease_strict"]
41         )
42 
43     if any(k in summary for k in ["min", "max"]):
44         batch.expect_column_values_to_be_between(
45             name, min_value=summary.get("min"), max_value=summary.get("max")
46         )
47 
48     return name, summary, batch
49 
50 
51 def categorical_expectations(name, summary, batch, *args):
52     # Use for both categorical and special case (boolean)
53     absolute_threshold = 10
54     relative_threshold = 0.2
55     if (
56         summary["n_distinct"] < absolute_threshold
57         or summary["p_distinct"] < relative_threshold
58     ):
59         batch.expect_column_values_to_be_in_set(
60             name, set(summary["value_counts_without_nan"].keys())
61         )
62     return name, summary, batch
63 
64 
65 def path_expectations(name, summary, batch, *args):
66     return name, summary, batch
67 
68 
69 def datetime_expectations(name, summary, batch, *args):
70     if any(k in summary for k in ["min", "max"]):
71         batch.expect_column_values_to_be_between(
72             name, min_value=summary.get("min"), max_value=summary.get("max")
73         )
74 
75     return name, summary, batch
76 
77 
78 def image_expectations(name, summary, batch, *args):
79     return name, summary, batch
80 
81 
82 def url_expectations(name, summary, batch, *args):
83     return name, summary, batch
84 
85 
86 def file_expectations(name, summary, batch, *args):
87     # By definition within our type logic, a file exists (as it's a path that also exists)
88     batch.expect_file_to_exist(name)
89 
90     return name, summary, batch
91
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/pandas_profiling/model/expectation_algorithms.py b/src/pandas_profiling/model/expectation_algorithms.py
--- a/src/pandas_profiling/model/expectation_algorithms.py
+++ b/src/pandas_profiling/model/expectation_algorithms.py
@@ -69,7 +69,10 @@
 def datetime_expectations(name, summary, batch, *args):
     if any(k in summary for k in ["min", "max"]):
         batch.expect_column_values_to_be_between(
-            name, min_value=summary.get("min"), max_value=summary.get("max")
+            name,
+            min_value=summary.get("min"),
+            max_value=summary.get("max"),
+            parse_strings_as_datetimes=True,
         )
 
     return name, summary, batch

{"golden_diff": "diff --git a/src/pandas_profiling/model/expectation_algorithms.py b/src/pandas_profiling/model/expectation_algorithms.py\n--- a/src/pandas_profiling/model/expectation_algorithms.py\n+++ b/src/pandas_profiling/model/expectation_algorithms.py\n@@ -69,7 +69,10 @@\n def datetime_expectations(name, summary, batch, *args):\r\n     if any(k in summary for k in [\"min\", \"max\"]):\r\n         batch.expect_column_values_to_be_between(\r\n-            name, min_value=summary.get(\"min\"), max_value=summary.get(\"max\")\r\n+            name,\r\n+            min_value=summary.get(\"min\"),\r\n+            max_value=summary.get(\"max\"),\r\n+            parse_strings_as_datetimes=True,\r\n         )\r\n \r\n     return name, summary, batch\n", "issue": "ExpectationProfiler fails to profile a datetime column\n**Describe the bug**\r\nI've encountered the following `TypeError` when trying to profile a dataframe that has a datetime column\r\n<details><summary>Click to expand <strong><em>Traceback</em></strong></summary>\r\n\r\n```python\r\n\r\nprofile.to_expectation_suite(suite_name=f\"{schema}.{table}\")\r\n[03/11/21 14:49:33] INFO     INFO - 2021-03-11 14:49:33,088 - utils.py - NumExpr utils.py:157\r\n                             defaulting to 4 threads.                                        \r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n~/ds-vroom-demand/great_expectations/uncommitted/test_profile.py in \r\n----> 15 profile.to_expectation_suite(suite_name=f\"{schema}.{table}\")\r\n\r\n~/.pyenv/versions/vroom/lib/python3.7/site-packages/pandas_profiling/expectations_report.py in to_expectation_suite(self, suite_name, data_context, save_suite, run_validation, build_data_docs, handler)\r\n     88         # Dispatch to expectations per semantic variable type\r\n     89         for name, variable_summary in summary[\"variables\"].items():\r\n---> 90             handler.handle(variable_summary[\"type\"], name, variable_summary, batch)\r\n     91 \r\n     92         # We don't actually update the suite object on the batch in place, so need\r\n\r\n...\r\n~/.pyenv/versions/vroom/lib/python3.7/site-packages/great_expectations/dataset/pandas_dataset.py in is_between(val)\r\n   1223                     ):\r\n   1224                         raise TypeError(\r\n-> 1225                             \"Column values, min_value, and max_value must either be None or of the same type.\"\r\n   1226                         )\r\n   1227 \r\n\r\n```\r\n</details>\r\n\r\n```python\r\nTypeError: Column values, min_value, and max_value must either be None or of the same type.\r\n```\r\n\r\nFrom looking at the arguments to `is_between` in `great_expectations.dataset.pandas_dataset.py`, this seems to be due to `min_value` and `max_value` being serialised to their string representations, but the column itself doesn't.\r\n\r\nI think this can be resolved by modifying the arguments to `datetime_expectations` in `pandas_profiling.model.expectation_algorithms` as follows \r\n\r\n```python\r\ndef datetime_expectations(name, summary, batch, *args):\r\n    if any(k in summary for k in [\"min\", \"max\"]):\r\n        batch.expect_column_values_to_be_between(\r\n            name, min_value=summary.get(\"min\"), max_value=summary.get(\"max\"), parse_strings_as_datetimes=True\r\n        )\r\n\r\n    return name, summary, batch\r\n```\r\nI've been able to resolve this issue myself by altering that function. I'm happy to submit this as a PR if this is acceptable.\r\n\r\n**To Reproduce**\r\n```python\r\n\"\"\"\r\nTest for issue XXX:\r\nhttps://github.com/pandas-profiling/pandas-profiling/issues/XXX\r\n\"\"\"\r\nimport pandas as pd\r\nimport pandas_profiling\r\n\r\n\r\ndef test_issueXXX():\r\n    df = pd.DataFrame({'date':pd.date_range('2021-01-01', '2021-03-01', freq='d')})\r\n    profile = pandas_profiling.ProfileReport(df=df, explorative=True)\r\n    profile.to_expectation_suite(suite_name='test',   save_suite=False, build_data_docs=False, run_validation=False)\r\n  \r\n```\r\n\r\n**Version information:**\r\n\r\n* _Python version_: 3.7.6\r\n* _Environment_: Pycharm\r\n* _`pip`_: \r\n\r\n<details><summary>Click to expand <strong><em>Version information</em></strong></summary>\r\n<p>\r\n\r\n```\r\nalembic==1.4.1\r\naltair==4.1.0\r\nappnope==0.1.2\r\nargon2-cffi==20.1.0\r\narrow==0.17.0\r\nastor==0.8.1\r\nasync-generator==1.10\r\nattrs==20.3.0\r\nazure-core==1.11.0\r\nazure-storage-blob==12.7.1\r\nbackcall==0.2.0\r\nbase58==2.1.0\r\nbinaryornot==0.4.4\r\nbleach==3.2.3\r\nblinker==1.4\r\nboto3==1.17.2\r\nbotocore==1.20.2\r\ncachetools==4.2.1\r\ncategory-encoders==2.2.2\r\ncertifi==2020.12.5\r\ncffi==1.14.4\r\nchardet==3.0.4\r\nclick==7.1.2\r\ncloudpickle==1.6.0\r\ncolorama==0.4.4\r\ncommonmark==0.9.1\r\nconfuse==1.4.0\r\ncookiecutter==1.7.2\r\ncryptography==3.3.1\r\ncycler==0.10.0\r\ndask==2021.2.0\r\ndatabricks-cli==0.14.1\r\ndecorator==4.4.2\r\ndefusedxml==0.6.0\r\ndistributed==2021.2.0\r\ndocker==4.4.2\r\ndocutils==0.16\r\nentrypoints==0.3\r\nFaker==6.0.0\r\nfastapi==0.63.0\r\nfeaturetools==0.23.1\r\nFlask==1.1.2\r\nfsspec==0.8.5\r\ngitdb==4.0.5\r\nGitPython==3.1.12\r\ngreat-expectations==0.13.8\r\ngunicorn==20.0.4\r\nHeapDict==1.0.1\r\nhtmlmin==0.1.12\r\nhypothesis==6.3.4\r\nidna==2.10\r\nImageHash==4.2.0\r\nimportlib-metadata==2.1.1\r\niniconfig==1.1.1\r\nipykernel==5.4.3\r\nipython==7.19.0\r\nipython-genutils==0.2.0\r\nipywidgets==7.6.3\r\nisodate==0.6.0\r\nitsdangerous==1.1.0\r\njedi==0.18.0\r\nJinja2==2.11.2\r\njinja2-time==0.2.0\r\njinjasql==0.1.8\r\njmespath==0.10.0\r\njoblib==1.0.0\r\njsonpatch==1.28\r\njsonpointer==2.0\r\njsonschema==3.2.0\r\njupyter==1.0.0\r\njupyter-client==6.1.11\r\njupyter-console==6.2.0\r\njupyter-core==4.7.0\r\njupyterlab-pygments==0.1.2\r\njupyterlab-widgets==1.0.0\r\nkiwisolver==1.3.1\r\nlightgbm==3.1.1\r\nlocket==0.2.1\r\nloky==2.9.0\r\nMako==1.1.4\r\nMarkupSafe==1.1.1\r\nmatplotlib==3.3.3\r\nmissingno==0.4.2\r\nmistune==0.8.4\r\nmlflow==1.13.1\r\nmock==4.0.3\r\nmsgpack==1.0.2\r\nmsrest==0.6.21\r\nmypy-extensions==0.4.3\r\nnbclient==0.5.1\r\nnbconvert==6.0.7\r\nnbformat==5.1.2\r\nnest-asyncio==1.5.1\r\nnetworkx==2.5\r\nnltk==3.5\r\nnotebook==6.2.0\r\nnumpy==1.19.5\r\noauthlib==3.1.0\r\nopt-einsum==3.3.0\r\npackaging==20.8\r\npandas==1.2.1\r\npandas-profiling==2.11.0\r\npandera==0.6.2\r\npandocfilters==1.4.3\r\nparso==0.8.1\r\npartd==1.1.0\r\npatsy==0.5.1\r\npexpect==4.8.0\r\nphik==0.11.2\r\npickleshare==0.7.5\r\nPillow==8.1.0\r\npluggy==0.13.1\r\npoyo==0.5.0\r\nprometheus-client==0.9.0\r\nprometheus-flask-exporter==0.18.1\r\nprompt-toolkit==3.0.14\r\nprotobuf==3.14.0\r\npsutil==5.8.0\r\npsycopg2-binary==2.8.6\r\nptyprocess==0.7.0\r\npy==1.10.0\r\npycparser==2.20\r\npydantic==1.7.3\r\npydeck==0.5.0\r\nPygments==2.7.4\r\npyOpenSSL==20.0.1\r\npyparsing==2.4.7\r\nPyPika==0.47.4\r\npyro-api==0.1.2\r\npyro-ppl==1.5.2\r\npyrsistent==0.17.3\r\npytest==6.2.2\r\npython-dateutil==2.8.1\r\npython-dotenv==0.15.0\r\npython-editor==1.0.4\r\npython-slugify==4.0.1\r\npytz==2020.5\r\nPyWavelets==1.1.1\r\nPyYAML==5.4.1\r\npyzmq==21.0.2\r\nqtconsole==5.0.2\r\nQtPy==1.9.0\r\nquerystring-parser==1.2.4\r\nregex==2020.11.13\r\nrequests==2.25.1\r\nrequests-oauthlib==1.3.0\r\nrich==9.11.0\r\nrpy2==3.4.2\r\nruamel.yaml==0.16.12\r\ns3transfer==0.3.4\r\nscikit-learn==0.24.1\r\nscipy==1.6.0\r\nseaborn==0.11.1\r\nSend2Trash==1.5.0\r\nshellingham==1.4.0\r\nsix==1.15.0\r\nsmart-open==4.2.0\r\nsmmap==3.0.5\r\nsortedcontainers==2.3.0\r\nSQLAlchemy==1.3.23\r\nsqlparse==0.4.1\r\nstarlette==0.13.6\r\nstatsmodels==0.12.2\r\nstreamlit==0.77.0\r\ntabulate==0.8.7\r\ntangled-up-in-unicode==0.0.6\r\ntblib==1.7.0\r\ntermcolor==1.1.0\r\nterminado==0.9.2\r\ntestpath==0.4.4\r\ntext-unidecode==1.3\r\nthreadpoolctl==2.1.0\r\ntoml==0.10.2\r\ntoolz==0.11.1\r\ntorch==1.7.1\r\ntornado==6.1\r\ntqdm==4.56.0\r\ntraitlets==5.0.5\r\ntyper==0.3.2\r\ntyper-cli==0.0.11\r\ntyping-extensions==3.7.4.3\r\ntyping-inspect==0.6.0\r\ntzlocal==2.1\r\nurllib3==1.25.11\r\nvalidators==0.18.2\r\nvisions==0.6.0\r\nwcwidth==0.2.5\r\nwebencodings==0.5.1\r\nwebsocket-client==0.57.0\r\nWerkzeug==1.0.1\r\nwidgetsnbextension==3.5.1\r\nwrapt==1.12.1\r\nzict==2.0.0\r\nzipp==3.4.0\r\n```\r\n</p></summary></details>\r\n\r\n\n", "before_files": [{"content": "def generic_expectations(name, summary, batch, *args):\r\n    batch.expect_column_to_exist(name)\r\n\r\n    if summary[\"n_missing\"] == 0:\r\n        batch.expect_column_values_to_not_be_null(name)\r\n\r\n    if summary[\"p_unique\"] == 1.0:\r\n        batch.expect_column_values_to_be_unique(name)\r\n\r\n    return name, summary, batch\r\n\r\n\r\ndef numeric_expectations(name, summary, batch, *args):\r\n    from great_expectations.profile.base import ProfilerTypeMapping\r\n\r\n    numeric_type_names = (\r\n        ProfilerTypeMapping.INT_TYPE_NAMES + ProfilerTypeMapping.FLOAT_TYPE_NAMES\r\n    )\r\n\r\n    batch.expect_column_values_to_be_in_type_list(\r\n        name,\r\n        numeric_type_names,\r\n        meta={\r\n            \"notes\": {\r\n                \"format\": \"markdown\",\r\n                \"content\": [\r\n                    \"The column values should be stored in one of these types.\"\r\n                ],\r\n            }\r\n        },\r\n    )\r\n\r\n    if summary[\"monotonic_increase\"]:\r\n        batch.expect_column_values_to_be_increasing(\r\n            name, strictly=summary[\"monotonic_increase_strict\"]\r\n        )\r\n\r\n    if summary[\"monotonic_decrease\"]:\r\n        batch.expect_column_values_to_be_decreasing(\r\n            name, strictly=summary[\"monotonic_decrease_strict\"]\r\n        )\r\n\r\n    if any(k in summary for k in [\"min\", \"max\"]):\r\n        batch.expect_column_values_to_be_between(\r\n            name, min_value=summary.get(\"min\"), max_value=summary.get(\"max\")\r\n        )\r\n\r\n    return name, summary, batch\r\n\r\n\r\ndef categorical_expectations(name, summary, batch, *args):\r\n    # Use for both categorical and special case (boolean)\r\n    absolute_threshold = 10\r\n    relative_threshold = 0.2\r\n    if (\r\n        summary[\"n_distinct\"] < absolute_threshold\r\n        or summary[\"p_distinct\"] < relative_threshold\r\n    ):\r\n        batch.expect_column_values_to_be_in_set(\r\n            name, set(summary[\"value_counts_without_nan\"].keys())\r\n        )\r\n    return name, summary, batch\r\n\r\n\r\ndef path_expectations(name, summary, batch, *args):\r\n    return name, summary, batch\r\n\r\n\r\ndef datetime_expectations(name, summary, batch, *args):\r\n    if any(k in summary for k in [\"min\", \"max\"]):\r\n        batch.expect_column_values_to_be_between(\r\n            name, min_value=summary.get(\"min\"), max_value=summary.get(\"max\")\r\n        )\r\n\r\n    return name, summary, batch\r\n\r\n\r\ndef image_expectations(name, summary, batch, *args):\r\n    return name, summary, batch\r\n\r\n\r\ndef url_expectations(name, summary, batch, *args):\r\n    return name, summary, batch\r\n\r\n\r\ndef file_expectations(name, summary, batch, *args):\r\n    # By definition within our type logic, a file exists (as it's a path that also exists)\r\n    batch.expect_file_to_exist(name)\r\n\r\n    return name, summary, batch\r\n", "path": "src/pandas_profiling/model/expectation_algorithms.py"}], "after_files": [{"content": "def generic_expectations(name, summary, batch, *args):\r\n    batch.expect_column_to_exist(name)\r\n\r\n    if summary[\"n_missing\"] == 0:\r\n        batch.expect_column_values_to_not_be_null(name)\r\n\r\n    if summary[\"p_unique\"] == 1.0:\r\n        batch.expect_column_values_to_be_unique(name)\r\n\r\n    return name, summary, batch\r\n\r\n\r\ndef numeric_expectations(name, summary, batch, *args):\r\n    from great_expectations.profile.base import ProfilerTypeMapping\r\n\r\n    numeric_type_names = (\r\n        ProfilerTypeMapping.INT_TYPE_NAMES + ProfilerTypeMapping.FLOAT_TYPE_NAMES\r\n    )\r\n\r\n    batch.expect_column_values_to_be_in_type_list(\r\n        name,\r\n        numeric_type_names,\r\n        meta={\r\n            \"notes\": {\r\n                \"format\": \"markdown\",\r\n                \"content\": [\r\n                    \"The column values should be stored in one of these types.\"\r\n                ],\r\n            }\r\n        },\r\n    )\r\n\r\n    if summary[\"monotonic_increase\"]:\r\n        batch.expect_column_values_to_be_increasing(\r\n            name, strictly=summary[\"monotonic_increase_strict\"]\r\n        )\r\n\r\n    if summary[\"monotonic_decrease\"]:\r\n        batch.expect_column_values_to_be_decreasing(\r\n            name, strictly=summary[\"monotonic_decrease_strict\"]\r\n        )\r\n\r\n    if any(k in summary for k in [\"min\", \"max\"]):\r\n        batch.expect_column_values_to_be_between(\r\n            name, min_value=summary.get(\"min\"), max_value=summary.get(\"max\")\r\n        )\r\n\r\n    return name, summary, batch\r\n\r\n\r\ndef categorical_expectations(name, summary, batch, *args):\r\n    # Use for both categorical and special case (boolean)\r\n    absolute_threshold = 10\r\n    relative_threshold = 0.2\r\n    if (\r\n        summary[\"n_distinct\"] < absolute_threshold\r\n        or summary[\"p_distinct\"] < relative_threshold\r\n    ):\r\n        batch.expect_column_values_to_be_in_set(\r\n            name, set(summary[\"value_counts_without_nan\"].keys())\r\n        )\r\n    return name, summary, batch\r\n\r\n\r\ndef path_expectations(name, summary, batch, *args):\r\n    return name, summary, batch\r\n\r\n\r\ndef datetime_expectations(name, summary, batch, *args):\r\n    if any(k in summary for k in [\"min\", \"max\"]):\r\n        batch.expect_column_values_to_be_between(\r\n            name,\r\n            min_value=summary.get(\"min\"),\r\n            max_value=summary.get(\"max\"),\r\n            parse_strings_as_datetimes=True,\r\n        )\r\n\r\n    return name, summary, batch\r\n\r\n\r\ndef image_expectations(name, summary, batch, *args):\r\n    return name, summary, batch\r\n\r\n\r\ndef url_expectations(name, summary, batch, *args):\r\n    return name, summary, batch\r\n\r\n\r\ndef file_expectations(name, summary, batch, *args):\r\n    # By definition within our type logic, a file exists (as it's a path that also exists)\r\n    batch.expect_file_to_exist(name)\r\n\r\n    return name, summary, batch\r\n", "path": "src/pandas_profiling/model/expectation_algorithms.py"}]}