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

Add system test for 'Table.create' using nested schema #3118

Merged
merged 1 commit into from
Mar 15, 2017
Merged

Add system test for 'Table.create' using nested schema #3118

merged 1 commit into from
Mar 15, 2017

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Mar 8, 2017

Derived from schema from @tswast.

Toward #3029.

@tseaver tseaver added api: bigquery Issues related to the BigQuery API. testing labels Mar 8, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 8, 2017
@@ -1026,7 +1026,7 @@ def _configure_job_metadata(metadata, # pylint: disable=too-many-arguments
load_config['writeDisposition'] = write_disposition


def _parse_schema_resource(info):
def parse_schema_resource(info):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

where = os.path.dirname(__file__)
json_filename = os.path.join(where, filename)

with open(json_filename) as schema_file:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -33,6 +35,15 @@ def _make_dataset_name(prefix):
return '%s%s' % (prefix, unique_resource_id())


def _load_json_schema(filename='bigquery_test_schema.json'):
from google.cloud.bigquery.table import parse_schema_resource
where = os.path.dirname(__file__)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -602,3 +613,18 @@ def test_dump_table_w_public_data(self):
dataset = Config.CLIENT.dataset(DATASET_NAME, project=PUBLIC)
table = dataset.table(TABLE_NAME)
self._fetch_single_page(table)

def test_create_table_nested_schema(self):
TABLE_NAME = 'test_table'

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@daspecster daspecster left a comment

Choose a reason for hiding this comment

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

LGTM aside from my one nit which could wait until it gets added to lint.

@@ -33,6 +38,14 @@ def _make_dataset_name(prefix):
return '%s%s' % (prefix, unique_resource_id())


def _load_json_schema(filename='bigquery_test_schema.json'):
from google.cloud.bigquery.table import _parse_schema_resource

This comment was marked as spam.

This comment was marked as spam.

@tseaver
Copy link
Contributor Author

tseaver commented Mar 14, 2017

@dhermes Any remaining issues?

Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

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

LGTM

@tseaver tseaver merged commit 965c17a into googleapis:master Mar 15, 2017
@tseaver tseaver deleted the 3029-bigquery-systest-create-w-complex-schema branch March 15, 2017 18:56
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
…-create-w-complex-schema

Add system test for 'Table.create' using nested schema
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 BigQuery API. cla: yes This human has signed the Contributor License Agreement. testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants