ibis-project / ibis

the portable Python dataframe library
https://ibis-project.org
Apache License 2.0
4.3k stars 537 forks source link

feat(common): introduce `FrozenOrderedDict` #9081

Closed kszucs closed 2 weeks ago

kszucs commented 2 weeks ago

Continuation of https://github.com/ibis-project/ibis/pull/9068 by adding FrozenOrderedDict which calculates its hash from tuple(self.items() rather than frozenset(self.items()) and also checks for item order during equality checks.

Closes #9063.

cpcloud commented 2 weeks ago

Clouds are good:

…/ibis on  fod 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
======================================================================================== test session starts =========================================================================================
platform linux -- Python 3.12.2, pytest-8.1.1, pluggy-1.5.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=104835057
rootdir: /home/cloud/src/ibis
configfile: pyproject.toml
plugins: anyio-4.3.0, xdist-3.5.0, pytest_httpserver-1.0.10, cov-5.0.0, timeout-2.3.1, benchmark-4.0.0, randomly-3.15.0, hypothesis-6.100.1, repeat-0.9.3, snapshot-0.9.0, mock-3.14.0, clarity-1.0.1
16 workers [3586 items]
..x.ssssssssssssssssssssssx.......x...........x..x................x........xx..x......x............x...............x....x...........x..........x....x...x...........x..............x...x...... [  5%]
........x...........................x.....x..x.........xx...x........x......x......x........x......x......x....x.............xx.................xxxxxxx.xxxx...x.....x..x.x.x................. [ 10%]
..xx........x......x......x....x.......x...x...........x.......................................x.........................................x.................................................... [ 15%]
..........x.............................xxx..s...............s.s..........................................s..........................x........x.x..........sx...x..x................s.s....... [ 21%]
..x..s.xx..x.....x..x..x.................x.xx....x.....x....x.x.....x.......xx.....x.......x..........x......x...x.xx.x........x...........x.................x..xx....x..x.................x.. [ 26%]
.x..xx..x.x..xx...x..xxx.xx.xx.....xx.....xxx.x...xxx.....x.x.........x........xx.x......................x.x...xx...x......x.x..x..x..x........................xx......xx...........x.....x... [ 31%]
x......x.xxxxxx.xxxx.x..x...xx.....x.x...x....xxxx..x...xxxx........x...x.......x.xx...xxx.....x.......xx...x........x..x.xx.........x...x.....x.x.........................x......x.....xx.... [ 37%]
.xx........x....................xx.xx.......xxxxxxx..x.x.xxxxxx.xxxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...x...xx..x...x........ [ 42%]
..x...x....x..x...x................................x......x..........................x..x........x......................x...........x.xx....x.........x..........x............x.....x......x... [ 47%]
......................x......xx.........x..................................................xx...xxxxxxxxx.x...xx..x..xxx...x.....x...x..x..................x...x......x..........x....x.x..x.. [ 53%]
.xx........x..................x.x.x...x........x....x.....x..x.............................x.......x..xxx..................x..........x..................x.............sx.....x.......x....... [ 58%]
........x............................................................s......................s....x..x.s...x......x.........x...s.x...x..............x.......x.............x......x............. [ 63%]
x....xx....xx.................x........x...xx.......x........xx.....x.....x.x........x...x.x............x.....................xx...x.......x...............x......x.x....x.................... [ 68%]
....x....x............x..................................................x..x.x..x..x..............x.....x........x...............x..x........xx...xx.xxx.xxxxxx.xx.x.................x.x....x [ 74%]
.........................xx.......x.........................xx.x.......x......x.x.........x.......x.........x.....x.....xx.............x..x.........x.x.xs..x..........................x..x... [ 79%]
...xxx.xxxx...xxx...x.x....x......xx........xxx.xx..xx....xxxxxxxx...xx.xxxxx.xxx.xxx........x.xxx.x...x.xx.xxxx.xx.x........x...........xx..x..............................x.x..x............ [ 84%]
...........................................................s..........s....................................................................................................................... [ 90%]
.............................................................................................................................................................................................. [ 95%]
.......................................................................................................x....s.........................xx.........................x..                           [100%]
===================================================================== 2978 passed, 39 skipped, 569 xfailed in 485.86s (0:08:05) ======================================================================