diff --git a/pybigquery/__init__.py b/pybigquery/__init__.py index 00b05749..947b72ad 100644 --- a/pybigquery/__init__.py +++ b/pybigquery/__init__.py @@ -16,4 +16,3 @@ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/pybigquery/parse_url.py b/pybigquery/parse_url.py index b9e308f6..879b2cbd 100644 --- a/pybigquery/parse_url.py +++ b/pybigquery/parse_url.py @@ -39,7 +39,7 @@ def parse_boolean(bool_string): def parse_url(url): # noqa: C901 - query = url.query + query = dict(url.query) # use_legacy_sql (legacy) if 'use_legacy_sql' in query: diff --git a/pybigquery/sqlalchemy_bigquery.py b/pybigquery/sqlalchemy_bigquery.py index 8cc0ffd6..4c9ae973 100644 --- a/pybigquery/sqlalchemy_bigquery.py +++ b/pybigquery/sqlalchemy_bigquery.py @@ -38,6 +38,7 @@ from sqlalchemy.engine.base import Engine from sqlalchemy.sql.schema import Column from sqlalchemy.sql import elements + import re from .parse_url import parse_url @@ -149,11 +150,11 @@ def create_cursor(self): class BigQueryCompiler(SQLCompiler): - def __init__(self, dialect, statement, column_keys=None, - inline=False, **kwargs): + def __init__(self, dialect, statement, column_keys=None, **kwargs): if isinstance(statement, Column): kwargs['compile_kwargs'] = util.immutabledict({'include_table': False}) - super(BigQueryCompiler, self).__init__(dialect, statement, column_keys, inline, **kwargs) + # TODO: handle this change to be compatible for all versions? + super(BigQueryCompiler, self).__init__(dialect, statement, column_keys=column_keys, **kwargs) def visit_select(self, *args, **kwargs): """ @@ -291,7 +292,6 @@ class BigQueryDialect(DefaultDialect): supports_unicode_statements = True supports_unicode_binds = True supports_native_decimal = True - returns_unicode_strings = True description_encoding = None supports_native_boolean = True supports_simple_order_by_label = True diff --git a/test/__init__.py b/test/__init__.py index 00b05749..947b72ad 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -16,4 +16,3 @@ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/test/test_sqlalchemy_bigquery.py b/test/test_sqlalchemy_bigquery.py index 788efe13..4ba2cc94 100644 --- a/test/test_sqlalchemy_bigquery.py +++ b/test/test_sqlalchemy_bigquery.py @@ -462,7 +462,7 @@ def test_dml(engine, session, table_dml): .filter(table_dml.c.string == 'test')\ .update({'string': 'updated_row'}, synchronize_session=False) updated_result = table_dml.select().execute().fetchone() - assert updated_result['test_pybigquery.sample_dml_string'] == 'updated_row' + assert updated_result['string'] == 'updated_row' # test delete session.query(table_dml).filter(table_dml.c.string == 'updated_row').delete(synchronize_session=False)