Skip to content

BigQuery's table.import() callback is invoked improperly #495

Description

@jwngr

If you pass a string filename into BigQuery's table.import() method, the callback is invoked with the improper arguments. The documentation says the callback should be called with this format:

function(error, job) { ... }

But it is actually invoked like this:

function(job) { ... }

This is caused by improperly handling the complete event of createWriteStream() on this line. The complete event fires with no error argument, but instead with the job as the first argument. So just forwarding the arguments onto callback results in the undocumented behavior.

A PR with a fix is coming right up!

Activity

  1. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: bigqueryIssues related to the BigQuery API.
    on May 14, 2015
  2. 17 remaining items

  3. added a commit that references this issue on Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🚨This issue needs some love.api: bigqueryIssues related to the BigQuery API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions