Skip to content

has_engine() ignores provided dataset if default dataset is set #51

@vinceatbluelabs

Description

@vinceatbluelabs

How to reproduce:

Initialize an engine with a default dataset (e.g., engine = create_engine('bigquery:///test_pybigquery'))

Create a table named 'mytable' in a dataset named 'other_schma'

Call engine.has_table() with an explicit dataset provided (engine.has_table(table_name='mytable', schema='other_schema'))

Expected result

True

Observed result

False

Notes

The logic in question is here: https://github.com/mxmzdlv/pybigquery/blob/master/pybigquery/sqlalchemy_bigquery.py#L371-L375

My read of the README here is that the dataset provided to create_engine() is a default dataset - and that the meaning of 'default' is one which is used when no dataset is provided.

If you agree that this is a legit issue, I can prep a PR if need be with updated tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions