diff --git a/cartoframes/data/observatory/catalog/dataset.py b/cartoframes/data/observatory/catalog/dataset.py index 46d27d4a0..c7268456d 100644 --- a/cartoframes/data/observatory/catalog/dataset.py +++ b/cartoframes/data/observatory/catalog/dataset.py @@ -386,7 +386,11 @@ def to_csv(self, file_path, credentials=None, limit=None, order_by=None, sql_que credentials of CARTO user account. If not provided, a default credentials (if set with :py:meth:`set_default_credentials `) will be used. - limit (int, optional): number of rows to be downloaded. + sql_query (str, optional): a query to select, filter or aggregate the content of the dataset. + For instance, to download just one row: `select * from {dataset} limit 1`. The placeholder + `{dataset}` is mandatory and it will be replaced by the actual dataset before running the query. + You can build any arbitrary query. + add_geom (boolean, optional): to include the geography when using the `sql_query` argument. Default to True. Raises: DOError: if you have not a valid license for the dataset being downloaded, @@ -415,7 +419,12 @@ def to_dataframe(self, credentials=None, limit=None, order_by=None, sql_query=No credentials of CARTO user account. If not provided, a default credentials (if set with :py:meth:`set_default_credentials `) will be used. - limit (int, optional): number of rows to be downloaded. + sql_query (str, optional): a query to select, filter or aggregate the content of the dataset. + For instance, to download just one row: `select * from {dataset} limit 1`. The placeholder + `{dataset}` is mandatory and it will be replaced by the actual dataset before running the query. + You can build any arbitrary query. + add_geom (boolean, optional): to include the geography when using the `sql_query` argument. Default to True. + Returns: pandas.DataFrame diff --git a/cartoframes/data/observatory/catalog/geography.py b/cartoframes/data/observatory/catalog/geography.py index 043218624..5472d6dfc 100644 --- a/cartoframes/data/observatory/catalog/geography.py +++ b/cartoframes/data/observatory/catalog/geography.py @@ -189,7 +189,10 @@ def to_csv(self, file_path, credentials=None, limit=None, order_by=None, sql_que credentials of CARTO user account. If not provided, a default credentials (if set with :py:meth:`set_default_credentials `) will be used. - limit (int, optional): number of rows to be downloaded. + sql_query (str, optional): a query to select, filter or aggregate the content of the geography dataset. + For instance, to download just one row: `select * from {geography} limit 1`. The placeholder + `{geography}` is mandatory and it will be replaced by the actual geography dataset before running + the query. You can build any arbitrary query. Raises: DOError: if you have not a valid license for the geography being downloaded, @@ -218,7 +221,10 @@ def to_dataframe(self, credentials=None, limit=None, order_by=None, sql_query=No credentials of CARTO user account. If not provided, a default credentials (if set with :py:meth:`set_default_credentials `) will be used. - limit (int, optional): number of rows to be downloaded. + sql_query (str, optional): a query to select, filter or aggregate the content of the geography dataset. + For instance, to download just one row: `select * from {geography} limit 1`. The placeholder + `{geography}` is mandatory and it will be replaced by the actual geography dataset before running + the query. You can build any arbitrary query. Returns: pandas.DataFrame