From e9208e3df8e7d098d628ad66d88590b1eca94eb4 Mon Sep 17 00:00:00 2001 From: Peter Lamut Date: Tue, 13 Aug 2019 14:43:49 +0200 Subject: [PATCH] Fix Pandas DataFrame load example under Python 2.7 --- bigquery/docs/snippets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bigquery/docs/snippets.py b/bigquery/docs/snippets.py index 249fbf7baafa..9b4218286402 100644 --- a/bigquery/docs/snippets.py +++ b/bigquery/docs/snippets.py @@ -2765,15 +2765,15 @@ def test_load_table_from_dataframe(client, to_delete, parquet_engine): dataset_ref = client.dataset(dataset_id) table_ref = dataset_ref.table("monty_python") records = [ - {"title": "The Meaning of Life", "release_year": 1983}, - {"title": "Monty Python and the Holy Grail", "release_year": 1975}, - {"title": "Life of Brian", "release_year": 1979}, - {"title": "And Now for Something Completely Different", "release_year": 1971}, + {"title": u"The Meaning of Life", "release_year": 1983}, + {"title": u"Monty Python and the Holy Grail", "release_year": 1975}, + {"title": u"Life of Brian", "release_year": 1979}, + {"title": u"And Now for Something Completely Different", "release_year": 1971}, ] # Optionally set explicit indices. # If indices are not specified, a column will be created for the default # indices created by pandas. - index = ["Q24980", "Q25043", "Q24953", "Q16403"] + index = [u"Q24980", u"Q25043", u"Q24953", u"Q16403"] dataframe = pandas.DataFrame(records, index=pandas.Index(index, name="wikidata_id")) job = client.load_table_from_dataframe(dataframe, table_ref, location="US")