diff --git a/cartoframes/data/observatory/catalog/entity.py b/cartoframes/data/observatory/catalog/entity.py index 57b0d05d1..ce92ce067 100644 --- a/cartoframes/data/observatory/catalog/entity.py +++ b/cartoframes/data/observatory/catalog/entity.py @@ -9,6 +9,19 @@ _PLATFORM_BQ = 'bq' +_DATASET_READ_MSG = '''To load it as a DataFrame you can do: + + df = pandas.read_csv('{}') +''' + +_GEOGRAPHY_READ_MSG = '''To load it as a GeoDataFrame you can do: + + from cartoframes.utils import decode_geometry + + df = pandas.read_csv('{}') + gdf = GeoDataFrame(df, geometry=decode_geometry(df['geom'])) +''' + class CatalogEntity(ABC): """This is an internal class the rest of the classes related to the catalog discovery extend. @@ -133,8 +146,11 @@ def _download(self, credentials, file_path=None, limit=None): if file_path: bq_client.download_to_file(job, file_path, column_names=column_names) - log.info('Data saved: {}.'.format(file_path)) - log.info("To read it you can do: `pandas.read_csv('{}')`.".format(file_path)) + log.info('Data saved: {}'.format(file_path)) + if self.__class__.__name__ == 'Dataset': + log.info(_DATASET_READ_MSG.format(file_path)) + elif self.__class__.__name__ == 'Geography': + log.info(_GEOGRAPHY_READ_MSG.format(file_path)) else: return bq_client.download_to_dataframe(job)