Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): bump sqlglot to pick up duckdb array fixes #8682

Merged
merged 25 commits into from
Mar 18, 2024

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Mar 17, 2024

Closes #8641. The fix was made upstream in sqlglot.

This PR ballooned into some other fixes:

  1. We're segfaulting a lot because of BUG: Seg Fault when st_aswkb() to arrow duckdb/duckdb_spatial#236. I removed geospatial tests from the duckdb 0.10 CI job and added a 0.9.2 job that should mitigate this until the next duckdb geospatial release.
  2. The sqlglot version bump introduced some changed SQL, so I updated the snapshots for that
  3. The sqlglot verison bump changed mssql limit output to use fetch instead of top, which breaks the case of limit 0. fetch first 0 rows only raises a DB error, while top 0 is allowed. I elected to xfail this for now but perhaps we should raise an issue on the sqlglot side?
  4. Because of the sqlglot bump, log function calls are now generated using log(x, y) (base first or not depends on the dialect) without explicitly constructing an Anonymous function using self.f.anon. This exposed a missing log implementation in the sqlite backend which I added.
  5. I addressed the failing test_zip_null test that was failing for the cloud backends. BigQuery xfails with an AssertionError because it turns NULL arrays into empty arrays and the fix for snowflake was to check for any NULL input arrays and return NULL accordingly.

@cpcloud cpcloud added this to the 9.0 milestone Mar 17, 2024
@cpcloud cpcloud added the sql Backends that generate SQL label Mar 17, 2024
@cpcloud cpcloud added tests Issues or PRs related to tests sqlite The SQLite backend duckdb The DuckDB backend labels Mar 18, 2024
@cpcloud
Copy link
Member Author

cpcloud commented Mar 18, 2024

I've removed geospatial from the primary duckdb ci job and added another job that runs geospatial tests while constraining the install of duckdb to be <0.10. This should avoid segfaulting in CI, and once duckdb/duckdb_spatial ships a new release we can go back to testing just one version of duckdb.

@cpcloud cpcloud added the ci-run-cloud Add this label to trigger a run of Bigquery and Snowflake in CI label Mar 18, 2024
@ibis-docs-bot ibis-docs-bot bot removed the ci-run-cloud Add this label to trigger a run of Bigquery and Snowflake in CI label Mar 18, 2024
@cpcloud
Copy link
Member Author

cpcloud commented Mar 18, 2024

Running the cloud tests locally since BigQuery CI takes over an hour to run.

@cpcloud
Copy link
Member Author

cpcloud commented Mar 18, 2024

Cloud tests are passing:

…/ibis on  bump-sqlglot is 📦 v8.0.0 via 🐍 v3.12.2 via ❄️   impure (ibis-3.12.2-env)
❯ pytest -m 'bigquery or snowflake' -n auto --dist loadgroup --snapshot-update -q
bringing up nodes...
..............................................................x....................................x...x.....xx...x........x.x......x.x...........x...x..xx..xxx.....x..........x.....x...x... [  5%]
..........x.xx..x......................................x....x..x........xx..........xx...xx.......xx.x..xx............x....x...x..x...x.............xxx..............................xx..x...x [ 11%]
...x....x.......x..x.......x..........................xx..x.....................x......x...x.xx..x..x.xx.......................................x.............................................. [ 16%]
.......x..........................................s........x.................x....x...............xx.........x...x...x.......x...xx..x...............s.........................xx.x..........x [ 22%]
................x........x...........................x..............x...xx......x.......x.....x......x.........................................x.x......x.......x................x...x.......x [ 28%]
......................xxx..................x......x......x..............xx..........x.x.....................xx..x...xxxxx.xxxxx.sx.......xx...xxxx.xxx..x.......xx......x...........x..x...x.. [ 33%]
........................x.....xx................................x......x...x...xxxx.........x..............x......x...x.............x.......x.xx......x...xx......xx..........x...x.....x..... [ 39%]
.............x..............x..................x...........x.....x....ssssssssssssssssssssssx...x..........xx...x...x......xxx...x..x.............x...........xx.............................x [ 45%]
........x.x.x.......x...x......x.........x...xxx.x.x..x.x.......x.....x....x.........x.x........x....x..........................xx....x....x.....x.x..................x...x..............x.... [ 50%]
....x..x..x...............................................x.xx.....x..x.x..x...........x.........x.....x...x..x..........x.x.x...x.....x..x.....x........x.x.........xx.x..x..x..x.x..xx....xx [ 56%]
................................xx....x...................................................................s...........s......x..x..s.....s...x...x.x...........xx..x.x...x...xx............... [ 62%]
.x..............x....x...x...................x..s.....................x...x......xx.x..x...........xx............xx....x........xxxx.....x........x...........x....x......x.......x..........x [ 67%]
.xxx.x.x.x..xx.x........x...........x.......................................................x.x..x..............................................................................xxxxxxxxx.xx.. [ 73%]
....xxx.xxxxx...x.x...x.xxx..x.xxxx.xxxxxx.xxxx...xxx.xx..x..x.x...x.x.x.x.......x.x...xxx..xx.xxx.x.xxxx.xxxxxxxxxx.xxx...x.x...xxx........x...x...........x......x......x..x...x............ [ 79%]
..xx.................x........x........x...x....x...x......x...xx...x.x.........x...................x......x.........x............x........................x.................................. [ 84%]
...................................x.......................................................................................................................................................... [ 90%]
........................................x........................................................................................................................................x............ [ 96%]
....................................................................................................sException ignored in: <socket.socket fd=16, family=2, type=1, proto=6, laddr=('192.168.50.72', 51904), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=16, family=2, type=1, proto=6, laddr=('192.168.50.72', 51904), raddr=('34.102.189.10', 443)>
..Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 51936), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 51936), raddr=('34.102.189.10', 443)>
....Exception ignored in: <socket.socket fd=16, family=2, type=1, proto=6, laddr=('192.168.50.72', 51980), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=16, family=2, type=1, proto=6, laddr=('192.168.50.72', 51980), raddr=('34.102.189.10', 443)>
....Exception ignored in: <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 52026), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 52026), raddr=('34.102.189.10', 443)>
....Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35072), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35072), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 35088), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 35088), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35106), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35106), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 35122), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 35122), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35126), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35126), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=19, family=2, type=1, proto=6, laddr=('192.168.50.72', 35144), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=19, family=2, type=1, proto=6, laddr=('192.168.50.72', 35144), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35142), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35142), raddr=('34.102.189.10', 443)>
.....Exception ignored in: <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 35198), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 35198), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 35204), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 35204), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35226), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35226), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35234), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 35234), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 35242), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 35242), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 35246), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 35246), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 35256), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 35256), raddr=('34.102.189.10', 443)>
...Exception ignored in: <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 44690), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=17, family=2, type=1, proto=6, laddr=('192.168.50.72', 44690), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 44700), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 44700), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 44714), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=32, family=2, type=1, proto=6, laddr=('192.168.50.72', 44714), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 44730), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=14, family=2, type=1, proto=6, laddr=('192.168.50.72', 44730), raddr=('34.102.189.10', 443)>
.Exception ignored in: <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 44736), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 44736), raddr=('34.102.189.10', 443)>
Exception ignored in: <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 44750), raddr=('34.102.189.10', 443)>
Traceback (most recent call last):
  File "/nix/store/lw9wd3vvhipidiik52px4q7my8463nin-python3-3.12.2-env/lib/python3.12/site-packages/snowflake/connector/vendored/urllib3/poolmanager.py", line 223, in clear
    self.pools.clear()
ResourceWarning: unclosed <socket.socket fd=27, family=2, type=1, proto=6, laddr=('192.168.50.72', 44750), raddr=('34.102.189.10', 443)>
..                                                           [100%]
2907 passed, 31 skipped, 424 xfailed in 472.68s (0:07:52)

@cpcloud cpcloud merged commit a3bd853 into ibis-project:main Mar 18, 2024
83 checks passed
@cpcloud cpcloud deleted the bump-sqlglot branch March 18, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duckdb The DuckDB backend sql Backends that generate SQL sqlite The SQLite backend tests Issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: array(literal).zip() errors
2 participants