if cell_body:
schema = google.datalab.utils.commands.parse_config(cell_body, None, False)
jsonschema.validate(schema, table_schema_schema)
schema = google.datalab.bigquery.Schema(schema["schema"])
table.create(schema=schema)
elif table.exists():
if args["mode"] == "create":
After Change
// schema can be an instance of google.datalab.bigquery.Schema.
// For example, user can run "my_schema = bq.Schema.from_data(df)" in a previous cell and
// specify "schema: $my_schema" in cell input.
if not isinstance(schema, google.datalab.bigquery.Schema):
jsonschema.validate(config, table_schema_schema)
schema = google.datalab.bigquery.Schema(schema)
table.create(schema=schema)
elif not table.exists():
raise Exception("table %s does not exist; use "create" as mode." % name)