-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add system test for 'Table.create' using nested schema #3118
Conversation
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
system_tests/bigquery.py
Outdated
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
system_tests/bigquery.py
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
system_tests/bigquery.py
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@dhermes Any remaining issues? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…-create-w-complex-schema Add system test for 'Table.create' using nested schema
Derived from schema from @tswast.
Toward #3029.