We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Incompatibilities with xarray > 2022.03
### Expected behaviour
ODC should work with current version of `xarray`. In `setup.py` there's an exclusion of `2022.6.0`, but I don't think that's sufficient. It'd be worth digging up the commit/PR that made that change.

### Actual behaviour

Tests are failing.

```
FAILED tests/api/test_grid_workflow.py::test_gridworkflow_with_time_depth - AssertionError
FAILED tests/api/test_virtual.py::test_aggregate - ValueError: time already exists as coordinate or variable name.
```

### Steps to reproduce the behaviour

`pytest tests/`

### Environment information

* Which ``datacube --version`` are you using?

 `develop` branch at `af59377327c363b9c52b55000b4024a0b3fbaa8b`

* What datacube deployment/enviornment are you running against?

  - Mambaforge
  - conda-forge 
  - Python 3.10





--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 from setuptools import setup, find_packages
4 
5 tests_require = [
6     'hypothesis',
7     'pycodestyle',
8     'pylint',
9     'pytest',
10     'pytest-cov',
11     'pytest-timeout',
12     'pytest-httpserver',
13     'moto',
14 ]
15 doc_require = [
16     'Sphinx',
17     'sphinx_rtd_theme',
18     'sphinx_autodoc_typehints',  # Propagate mypy info into docs
19     'sphinx-click',
20     'recommonmark',
21     'setuptools',  # version related dependencies
22     'setuptools_scm[toml]',
23 ]
24 
25 extras_require = {
26     'performance': ['ciso8601', 'bottleneck'],
27     'distributed': ['distributed', 'dask[distributed]'],
28     'doc': doc_require,
29     's3': ['boto3', 'botocore'],
30     'test': tests_require,
31     'cf': ['compliance-checker>=4.0.0'],
32 }
33 
34 extras_require['dev'] = sorted(set(sum([extras_require[k] for k in [
35     'test',
36     'doc',
37     'performance',
38     's3',
39     'distributed',
40 ]], [])))
41 
42 # An 'all' option, following ipython naming conventions.
43 extras_require['all'] = sorted(set(sum(extras_require.values(), [])))
44 
45 extra_plugins = dict(read=[], write=[], index=[])
46 
47 setup(
48     name='datacube',
49     python_requires='>=3.8.0',
50 
51     url='https://github.com/opendatacube/datacube-core',
52     author='Open Data Cube',
53     maintainer='Open Data Cube',
54     maintainer_email='',
55     description='An analysis environment for satellite and other earth observation data',
56     long_description=open('README.rst').read(),
57     long_description_content_type='text/x-rst',
58     license='Apache License 2.0',
59     classifiers=[
60         "Development Status :: 4 - Beta",
61         "Intended Audience :: Developers",
62         "Intended Audience :: Science/Research",
63         "License :: OSI Approved :: Apache Software License",
64         "Natural Language :: English",
65         "Operating System :: MacOS :: MacOS X",
66         "Operating System :: POSIX",
67         "Operating System :: POSIX :: BSD",
68         "Operating System :: POSIX :: Linux",
69         "Operating System :: Microsoft :: Windows",
70         "Programming Language :: Python",
71         "Programming Language :: Python :: 3",
72         "Programming Language :: Python :: 3.8",
73         "Programming Language :: Python :: 3.9",
74         "Programming Language :: Python :: 3.10",
75         "Topic :: Scientific/Engineering :: GIS",
76         "Topic :: Scientific/Engineering :: Information Analysis",
77     ],
78 
79     packages=find_packages(
80         exclude=('tests', 'tests.*',
81                  'integration_tests', 'integration_tests.*')
82     ),
83     package_data={
84         '': ['*.yaml', '*/*.yaml'],
85         'datacube': ['py.typed'],
86     },
87     scripts=[],
88     install_requires=[
89         'affine',
90         'pyproj>=2.5',
91         'shapely>=1.6.4',
92         'cachetools',
93         'click>=5.0',
94         'cloudpickle>=0.4',
95         'dask[array]',
96         'distributed',
97         'jsonschema',
98         'netcdf4',
99         'numpy',
100         'psycopg2',
101         'lark',
102         'pandas',
103         'python-dateutil',
104         'pyyaml',
105         'rasterio>=1.3.2',  # Warping broken in 1.3.0 and 1.3.1
106         'sqlalchemy',
107         'GeoAlchemy2',
108         'toolz',
109         'xarray>=0.9,!=2022.6.0',  # >0.9 fixes most problems with `crs` attributes being lost
110     ],
111     extras_require=extras_require,
112     tests_require=tests_require,
113 
114     entry_points={
115         'console_scripts': [
116             'datacube = datacube.scripts.cli_app:cli',
117             'datacube-search = datacube.scripts.search_tool:cli',
118             'datacube-worker = datacube.execution.worker:main',
119         ],
120         'datacube.plugins.io.read': [
121             'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',
122             *extra_plugins['read'],
123         ],
124         'datacube.plugins.io.write': [
125             'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',
126             *extra_plugins['write'],
127         ],
128         'datacube.plugins.index': [
129             'default = datacube.index.postgres.index:index_driver_init',
130             'null = datacube.index.null.index:index_driver_init',
131             'memory = datacube.index.memory.index:index_driver_init',
132             'postgis = datacube.index.postgis.index:index_driver_init',
133             *extra_plugins['index'],
134         ],
135     },
136 )
137
```
--- 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/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -106,7 +106,7 @@
         'sqlalchemy',
         'GeoAlchemy2',
         'toolz',
-        'xarray>=0.9,!=2022.6.0',  # >0.9 fixes most problems with `crs` attributes being lost
+        'xarray>=0.9,<2022.6',  # >0.9 fixes most problems with `crs` attributes being lost
     ],
     extras_require=extras_require,
     tests_require=tests_require,

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -106,7 +106,7 @@\n         'sqlalchemy',\n         'GeoAlchemy2',\n         'toolz',\n-        'xarray>=0.9,!=2022.6.0',  # >0.9 fixes most problems with `crs` attributes being lost\n+        'xarray>=0.9,<2022.6',  # >0.9 fixes most problems with `crs` attributes being lost\n     ],\n     extras_require=extras_require,\n     tests_require=tests_require,\n", "issue": "Incompatibilities with xarray > 2022.03\n### Expected behaviour\r\nODC should work with current version of `xarray`. In `setup.py` there's an exclusion of `2022.6.0`, but I don't think that's sufficient. It'd be worth digging up the commit/PR that made that change.\r\n\r\n### Actual behaviour\r\n\r\nTests are failing.\r\n\r\n```\r\nFAILED tests/api/test_grid_workflow.py::test_gridworkflow_with_time_depth - AssertionError\r\nFAILED tests/api/test_virtual.py::test_aggregate - ValueError: time already exists as coordinate or variable name.\r\n```\r\n\r\n### Steps to reproduce the behaviour\r\n\r\n`pytest tests/`\r\n\r\n### Environment information\r\n\r\n* Which ``datacube --version`` are you using?\r\n\r\n `develop` branch at `af59377327c363b9c52b55000b4024a0b3fbaa8b`\r\n\r\n* What datacube deployment/enviornment are you running against?\r\n\r\n  - Mambaforge\r\n  - conda-forge \r\n  - Python 3.10\r\n\r\n\r\n\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\ntests_require = [\n    'hypothesis',\n    'pycodestyle',\n    'pylint',\n    'pytest',\n    'pytest-cov',\n    'pytest-timeout',\n    'pytest-httpserver',\n    'moto',\n]\ndoc_require = [\n    'Sphinx',\n    'sphinx_rtd_theme',\n    'sphinx_autodoc_typehints',  # Propagate mypy info into docs\n    'sphinx-click',\n    'recommonmark',\n    'setuptools',  # version related dependencies\n    'setuptools_scm[toml]',\n]\n\nextras_require = {\n    'performance': ['ciso8601', 'bottleneck'],\n    'distributed': ['distributed', 'dask[distributed]'],\n    'doc': doc_require,\n    's3': ['boto3', 'botocore'],\n    'test': tests_require,\n    'cf': ['compliance-checker>=4.0.0'],\n}\n\nextras_require['dev'] = sorted(set(sum([extras_require[k] for k in [\n    'test',\n    'doc',\n    'performance',\n    's3',\n    'distributed',\n]], [])))\n\n# An 'all' option, following ipython naming conventions.\nextras_require['all'] = sorted(set(sum(extras_require.values(), [])))\n\nextra_plugins = dict(read=[], write=[], index=[])\n\nsetup(\n    name='datacube',\n    python_requires='>=3.8.0',\n\n    url='https://github.com/opendatacube/datacube-core',\n    author='Open Data Cube',\n    maintainer='Open Data Cube',\n    maintainer_email='',\n    description='An analysis environment for satellite and other earth observation data',\n    long_description=open('README.rst').read(),\n    long_description_content_type='text/x-rst',\n    license='Apache License 2.0',\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Natural Language :: English\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Topic :: Scientific/Engineering :: GIS\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n    ],\n\n    packages=find_packages(\n        exclude=('tests', 'tests.*',\n                 'integration_tests', 'integration_tests.*')\n    ),\n    package_data={\n        '': ['*.yaml', '*/*.yaml'],\n        'datacube': ['py.typed'],\n    },\n    scripts=[],\n    install_requires=[\n        'affine',\n        'pyproj>=2.5',\n        'shapely>=1.6.4',\n        'cachetools',\n        'click>=5.0',\n        'cloudpickle>=0.4',\n        'dask[array]',\n        'distributed',\n        'jsonschema',\n        'netcdf4',\n        'numpy',\n        'psycopg2',\n        'lark',\n        'pandas',\n        'python-dateutil',\n        'pyyaml',\n        'rasterio>=1.3.2',  # Warping broken in 1.3.0 and 1.3.1\n        'sqlalchemy',\n        'GeoAlchemy2',\n        'toolz',\n        'xarray>=0.9,!=2022.6.0',  # >0.9 fixes most problems with `crs` attributes being lost\n    ],\n    extras_require=extras_require,\n    tests_require=tests_require,\n\n    entry_points={\n        'console_scripts': [\n            'datacube = datacube.scripts.cli_app:cli',\n            'datacube-search = datacube.scripts.search_tool:cli',\n            'datacube-worker = datacube.execution.worker:main',\n        ],\n        'datacube.plugins.io.read': [\n            'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',\n            *extra_plugins['read'],\n        ],\n        'datacube.plugins.io.write': [\n            'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',\n            *extra_plugins['write'],\n        ],\n        'datacube.plugins.index': [\n            'default = datacube.index.postgres.index:index_driver_init',\n            'null = datacube.index.null.index:index_driver_init',\n            'memory = datacube.index.memory.index:index_driver_init',\n            'postgis = datacube.index.postgis.index:index_driver_init',\n            *extra_plugins['index'],\n        ],\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nfrom setuptools import setup, find_packages\n\ntests_require = [\n    'hypothesis',\n    'pycodestyle',\n    'pylint',\n    'pytest',\n    'pytest-cov',\n    'pytest-timeout',\n    'pytest-httpserver',\n    'moto',\n]\ndoc_require = [\n    'Sphinx',\n    'sphinx_rtd_theme',\n    'sphinx_autodoc_typehints',  # Propagate mypy info into docs\n    'sphinx-click',\n    'recommonmark',\n    'setuptools',  # version related dependencies\n    'setuptools_scm[toml]',\n]\n\nextras_require = {\n    'performance': ['ciso8601', 'bottleneck'],\n    'distributed': ['distributed', 'dask[distributed]'],\n    'doc': doc_require,\n    's3': ['boto3', 'botocore'],\n    'test': tests_require,\n    'cf': ['compliance-checker>=4.0.0'],\n}\n\nextras_require['dev'] = sorted(set(sum([extras_require[k] for k in [\n    'test',\n    'doc',\n    'performance',\n    's3',\n    'distributed',\n]], [])))\n\n# An 'all' option, following ipython naming conventions.\nextras_require['all'] = sorted(set(sum(extras_require.values(), [])))\n\nextra_plugins = dict(read=[], write=[], index=[])\n\nsetup(\n    name='datacube',\n    python_requires='>=3.8.0',\n\n    url='https://github.com/opendatacube/datacube-core',\n    author='Open Data Cube',\n    maintainer='Open Data Cube',\n    maintainer_email='',\n    description='An analysis environment for satellite and other earth observation data',\n    long_description=open('README.rst').read(),\n    long_description_content_type='text/x-rst',\n    license='Apache License 2.0',\n    classifiers=[\n        \"Development Status :: 4 - Beta\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Natural Language :: English\",\n        \"Operating System :: MacOS :: MacOS X\",\n        \"Operating System :: POSIX\",\n        \"Operating System :: POSIX :: BSD\",\n        \"Operating System :: POSIX :: Linux\",\n        \"Operating System :: Microsoft :: Windows\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.8\",\n        \"Programming Language :: Python :: 3.9\",\n        \"Programming Language :: Python :: 3.10\",\n        \"Topic :: Scientific/Engineering :: GIS\",\n        \"Topic :: Scientific/Engineering :: Information Analysis\",\n    ],\n\n    packages=find_packages(\n        exclude=('tests', 'tests.*',\n                 'integration_tests', 'integration_tests.*')\n    ),\n    package_data={\n        '': ['*.yaml', '*/*.yaml'],\n        'datacube': ['py.typed'],\n    },\n    scripts=[],\n    install_requires=[\n        'affine',\n        'pyproj>=2.5',\n        'shapely>=1.6.4',\n        'cachetools',\n        'click>=5.0',\n        'cloudpickle>=0.4',\n        'dask[array]',\n        'distributed',\n        'jsonschema',\n        'netcdf4',\n        'numpy',\n        'psycopg2',\n        'lark',\n        'pandas',\n        'python-dateutil',\n        'pyyaml',\n        'rasterio>=1.3.2',  # Warping broken in 1.3.0 and 1.3.1\n        'sqlalchemy',\n        'GeoAlchemy2',\n        'toolz',\n        'xarray>=0.9,<2022.6',  # >0.9 fixes most problems with `crs` attributes being lost\n    ],\n    extras_require=extras_require,\n    tests_require=tests_require,\n\n    entry_points={\n        'console_scripts': [\n            'datacube = datacube.scripts.cli_app:cli',\n            'datacube-search = datacube.scripts.search_tool:cli',\n            'datacube-worker = datacube.execution.worker:main',\n        ],\n        'datacube.plugins.io.read': [\n            'netcdf = datacube.drivers.netcdf.driver:reader_driver_init',\n            *extra_plugins['read'],\n        ],\n        'datacube.plugins.io.write': [\n            'netcdf = datacube.drivers.netcdf.driver:writer_driver_init',\n            *extra_plugins['write'],\n        ],\n        'datacube.plugins.index': [\n            'default = datacube.index.postgres.index:index_driver_init',\n            'null = datacube.index.null.index:index_driver_init',\n            'memory = datacube.index.memory.index:index_driver_init',\n            'postgis = datacube.index.postgis.index:index_driver_init',\n            *extra_plugins['index'],\n        ],\n    },\n)\n", "path": "setup.py"}]}