Skip to content

Commit

Permalink
Merge pull request #1621 from CartoDB/dgaubert/ch71126/add-documentat…
Browse files Browse the repository at this point in the history
…ion-to-to-dataframe-and-to

Add documentation to 'to_dataframe' and 'to_csv' methods
  • Loading branch information
dgaubert authored Apr 23, 2020
2 parents 07c4ed2 + 0bdf77d commit a797da9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 11 additions & 2 deletions cartoframes/data/observatory/catalog/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
<cartoframes.auth.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,
Expand Down Expand Up @@ -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
<cartoframes.auth.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
Expand Down
10 changes: 8 additions & 2 deletions cartoframes/data/observatory/catalog/geography.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
<cartoframes.auth.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,
Expand Down Expand Up @@ -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
<cartoframes.auth.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
Expand Down

0 comments on commit a797da9

Please sign in to comment.