Skip to content

docs: update docstrings of DataFrame and related files #1092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 24, 2024
Merged
16 changes: 11 additions & 5 deletions bigframes/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,20 @@ def _to_sql_query(
whether to include index columns.

Returns:
a tuple of (sql_string, index_column_id_list, index_column_label_list).
Tuple[sql_string, index_column_id_list, index_column_label_list]:
If include_index is set to False, index_column_id_list and index_column_label_list
return empty lists.
"""
return self._block.to_sql_query(include_index, enable_cache=enable_cache)

@property
def sql(self) -> str:
"""Compiles this DataFrame's expression tree to SQL."""
"""Compiles this DataFrame's expression tree to SQL.

Returns:
str:
string representing the compiled SQL.
"""
include_index = self._has_index and (
self.index.name is not None or len(self.index.names) > 1
)
Expand All @@ -399,8 +404,9 @@ def query_job(self) -> Optional[bigquery.QueryJob]:
"""BigQuery job metadata for the most recent query.

Returns:
The most recent `QueryJob
<https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob>`_.
None or google.cloud.bigquery.QueryJob:
The most recent `QueryJob
<https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob>`_.
"""
if self._query_job is None:
self._set_internal_query_job(self._compute_dry_run())
Expand Down Expand Up @@ -3763,7 +3769,7 @@ def cache(self):
Useful if the dataframe will be used multiple times, as this will avoid recomputating the shared intermediate value.

Returns:
DataFrame: Self
bigframes.pandas.DataFrame: DataFrame
"""
return self._cached(force=True)

Expand Down
Loading