Skip to content

docs: add runnable code samples for reading methods #125

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 4 commits into from
Oct 21, 2023

Conversation

ashleyxuu
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@ashleyxuu ashleyxuu requested review from a team as code owners October 19, 2023 22:07
@ashleyxuu ashleyxuu requested a review from jiaxunwu October 19, 2023 22:07
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. samples Issues that are directly related to samples. labels Oct 19, 2023
@ashleyxuu
Copy link
Contributor Author

Just did the staging: https://cloud.devsite.corp.google.com/python/docs/reference/bigframes/latest/bigframes.session.Session#bigframes_session_Session_read_gbq_table

The question now is to choose (using read_gbq as an example)

  1. df = read.gbq("xxx") -> don't display the output
  2. read.gbq("xxx").head(5) -> showing the output for first 5 rows

@ashleyxuu ashleyxuu force-pushed the ashleyxu-add-runnable-code-samples branch from 240b9fd to 0a28802 Compare October 20, 2023 03:59
@ashleyxuu
Copy link
Contributor Author

We decided to follow the pattern like below for adding runnable and testable code samples:

df = read.gbq("xxx")
df.head(2)

The new staging: https://cloud.devsite.corp.google.com/python/docs/reference/bigframes/latest/bigframes.session.Session#bigframes_session_Session_read_csv

@ashleyxuu ashleyxuu requested review from shobsi and tswast October 20, 2023 04:05
@ashleyxuu ashleyxuu force-pushed the ashleyxu-add-runnable-code-samples branch from f2401f6 to c11fc1b Compare October 21, 2023 04:07
@ashleyxuu ashleyxuu merged commit a669919 into main Oct 21, 2023
@ashleyxuu ashleyxuu deleted the ashleyxu-add-runnable-code-samples branch October 21, 2023 05:27
ashleyxuu added a commit that referenced this pull request Oct 21, 2023
* docs: add runnable and testable I/O code samples

* docs: add runnable and testable reading methods code snippets

* fix: assign a df and show the first 2 rows

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. samples Issues that are directly related to samples. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants