xcube-dev / xcube

xcube is a Python package for generating and exploiting data cubes powered by xarray, dask, and zarr.
https://xcube.readthedocs.io/
MIT License
201 stars 20 forks source link

xcube cannot access geotiff datasets from public buckets #893

Closed TonioF closed 1 year ago

TonioF commented 1 year ago

To Reproduce Steps to reproduce the behavior:

  1. Create an xcube store to geotiff datasets stored in a public s3 bucket (e.g., from here: https://registry.opendata.aws/copernicus-dem/ )
  2. Open one of the datasets (ds = store.open_data(...) )
  3. Try to open the base_dataset: ds.base_dataset
  4. You'll receive this error: AttributeError: 'NoneType' object has no attribute 'Session'

It seems this error only occurs when boto3 is not installed. Also, it started appearing with xcube 1.1.2.

pont-us commented 1 year ago

Confirmed with a fresh xcube 1.2.0 install from conda-forge and the following code.

import xcube.core.store

datastore = xcube.core.store.new_data_store(
    's3',
    root='copernicus-dem-30m'
)

dataset = datastore.open_data(
    'Copernicus_DSM_COG_10_S15_00_E143_00_DEM/'
    'Copernicus_DSM_COG_10_S15_00_E143_00_DEM.tif'
)

print(dataset.base_dataset)