Skip to content
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

docs: correct some bigquery README sample #247

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from a metadata server.
This is also described in [google-cloud-auth](https://github.com/yoshidan/google-cloud-rust/blob/main/foundation/auth/README.md)

```rust
use google_cloud_pubsub::client::{ClientConfig, Client};
use google_cloud_bigquery::client::{ClientConfig, Client};

async fn run() {
let (config, project_id) = ClientConfig::new_with_auth().await.unwrap();
Expand Down Expand Up @@ -56,8 +56,8 @@ async fn run(client: &Client, project_id: &str) {
query: "SELECT * FROM dataset.table".to_string(),
..Default::default()
};
let mut iter = client.query(project_id, request).await.unwrap();
while let Some(row) = iter.next::<Row>().await.unwrap() {
let mut iter = client.query::<Row>(project_id, request).await.unwrap();
while let Some(row) = iter.next().await.unwrap() {
Comment on lines +59 to +60
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler complained here to "remove the generic" from iter.next::<Row>. Meanwhile, the documentation for client.query itself includes query::<Row> as the correct type annotation.

let col1 = row.column::<String>(0);
let col2 = row.column::<Option<String>>(1);
}
Expand Down