Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
[x] Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
[x] Ensure the tests and linter pass
[x] Code coverage does not decrease (if any source code was changed)
[x] Appropriate docs were updated (if necessary)
Fixes # 🦕
According to BQ docs, the syntax for except and intersect is EXCEPT DISTINCT and INTERSECT DISTINCT respectively.
DatabaseError: (google.cloud.bigquery.dbapi.exceptions.DatabaseError) 400 EXCEPT must be followed by ALL, DISTINCT, or "(" at [2:35]
[SQL: SELECT `set_example`.`id`
FROM `holyoke_test`.`set_example` EXCEPT SELECT `set_example`.`id`
FROM `holyoke_test`.`set_example`
WHERE `set_example`.`value` >= %(value_1:INT64)s]
[parameters: {'value_1': 5}]
(Background on this error at: https://sqlalche.me/e/14/4xp6)
DatabaseError: (google.cloud.bigquery.dbapi.exceptions.DatabaseError) 400 Syntax error: Expected keyword ALL or keyword DISTINCT but got keyword SELECT at [2:45]
[SQL: SELECT `set_example`.`id`
FROM `holyoke_test`.`set_example` INTERSECT SELECT `set_example`.`id`
FROM `holyoke_test`.`set_example`
WHERE `set_example`.`value` >= %(value_1:INT64)s]
[parameters: {'value_1': 5}]
(Background on this error at: https://sqlalche.me/e/14/4xp6)
After this change we get:
[(5,), (1,), (4,)]
It seems that this was discussed here with the maintainers of SA: https://github.com/sqlalchemy/sqlalchemy/issues/11545, and the recommendation is for the dialect to implement the correct compound keywords for except_ and intersect
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes # 🦕
According to BQ docs, the syntax for except and intersect is EXCEPT DISTINCT and INTERSECT DISTINCT respectively.
For example,
Before this change we get:
After this change we get:
[(2,), (3,), (6,)]
Similarly, with
Before this change we get:
After this change we get:
[(5,), (1,), (4,)]
It seems that this was discussed here with the maintainers of SA: https://github.com/sqlalchemy/sqlalchemy/issues/11545, and the recommendation is for the dialect to implement the correct compound keywords for
except_
andintersect