Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Dropping usage of "size" to measure (resumable) bytes uploaded.#18

Merged
dhermes merged 1 commit intogoogleapis:masterfrom
dhermes:fix-use-of-size
Jul 21, 2017
Merged

Dropping usage of "size" to measure (resumable) bytes uploaded.#18
dhermes merged 1 commit intogoogleapis:masterfrom
dhermes:fix-use-of-size

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented Jul 20, 2017

Also made some tweaks in nox.py to allow passing through positional args, e.g.

nox -s "unit_tests(python_version='3.6')" -r -- --pdb

/cc @tseaver

This is required (with a release) to finish googleapis/google-cloud-python#3555. As I stated there, I made a bad assumption that size would always be in the 200 response when a resumable upload is concluded.


For "inspection", compare a Storage response

{
  "bucket": "{BUCKET}",
  "contentType": "text/plain",
  "crc32c": "MR/5OA==",
  "etag": "CMm6nMn0mNUCEAE=",
  "generation": "1500589786078537",
  "id": "{BUCKET}/{FILENAME}.txt/1500589786078537",
  "kind": "storage#object",
  "md5Hash": "vl1dN1Qtdfk6hwlEWfdmeA==",
  "mediaLink": "https://www.googleapis.com/download/storage/v1/b/{BUCKET}/o/{FILENAME}.txt?generation=1500589786078537&alt=media",
  "metageneration": "1",
  "name": "{FILENAME}.txt",
  "selfLink": "https://www.googleapis.com/storage/v1/b/{BUCKET}/o/{FILENAME}.txt",
  "size": "3",
  "storageClass": "STANDARD",
  "timeCreated": "2017-07-20T22:29:46.047Z",
  "timeStorageClassUpdated": "2017-07-20T22:29:46.047Z",
  "updated": "2017-07-20T22:29:46.047Z"
}

to a BigQuery response

{
  "configuration": {
    "load": {
      "createDisposition": "CREATE_NEVER",
      "destinationTable": {
        "datasetId": "dml_tests_1500588804031",
        "projectId": "{PROJECT}",
        "tableId": "test_table"
      },
      "schema": {
        "fields": [
          {
            "mode": "NULLABLE",
            "name": "greeting",
            "type": "STRING"
          }
        ]
      },
      "skipLeadingRows": 1,
      "sourceFormat": "CSV",
      "writeDisposition": "WRITE_EMPTY"
    }
  },
  "etag": "\"ermsQgwazUAYa5aKJk06ue7LJtk/6j_Fsvq--9PWiausL_U0gZdiOaQ\"",
  "id": "{PROJECT}:job_CNzVVbYe_lc5oY0J-h_WX-Oc0lQ",
  "jobReference": {
    "jobId": "job_CNzVVbYe_lc5oY0J-h_WX-Oc0lQ",
    "projectId": "{PROJECT}"
  },
  "kind": "bigquery#job",
  "selfLink": "https://www.googleapis.com/bigquery/v2/projects/{PROJECT}/jobs/job_CNzVVbYe_lc5oY0J-h_WX-Oc0lQ",
  "statistics": {
    "creationTime": "1500588807360",
    "startTime": "1500588807880"
  },
  "status": {
    "state": "RUNNING"
  },
  "user_email": "{USERNAME}@developer.gserviceaccount.com"
}

@dhermes dhermes merged commit 7d889ad into googleapis:master Jul 21, 2017
@dhermes dhermes deleted the fix-use-of-size branch July 21, 2017 17:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants