b8caa754bc51f74ae82b5ef774a77261ef21a05e,google/datalab/bigquery/commands/_bigquery.py,,_load_cell,#Any#Any#,887

Before Change


  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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: googledatalab/pydatalab
Commit Name: b8caa754bc51f74ae82b5ef774a77261ef21a05e
Time: 2017-09-11
Author: qimingj@users.noreply.github.com
File Name: google/datalab/bigquery/commands/_bigquery.py
Class Name:
Method Name: _load_cell


Project Name: home-assistant/home-assistant
Commit Name: 1e92417804ddc8c5ea2eb9a5d857d0a8ce3e25ab
Time: 2017-11-03
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/xiaomi_aqara.py
Class Name:
Method Name: setup


Project Name: home-assistant/home-assistant
Commit Name: 8f774e9c531555cdf31d2ff5f955a9e27ad85404
Time: 2017-11-02
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/xiaomi_aqara.py
Class Name:
Method Name: setup