# No change with partition\_hint

**URL:** <https://discuss.hail.is/t/no-change-with-partition-hint/3497>\
**Category:** Hail Query & hailctl\
**Created:** [July 19, 2023, 2:01pm UTC](https://discuss.hail.is/t/no-change-with-partition-hint/3497 "2023-07-19T14:01:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![klaricch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/klaricch/32/643_2.png) [@klaricch](https://discuss.hail.is/u/klaricch)\
**Post date:** [July 19, 2023, 2:01pm UTC](https://discuss.hail.is/t/no-change-with-partition-hint/3497/1 "2023-07-19T14:01:40Z")

</div>

Hi Hail Team,

Under what conditions does a supplied partition\_hint get used to repartition a Table?

With the below code, “new\_ht” has the same number of partitions as “ht” after supplying a partition\_hint (although “new\_ht” is only slightly smaller than “ht”).

```python
ht = hl.read_table(ht_path)

grouping = hl.struct(context=ht.context, 
                      ref=ht.ref, 
                      alt=ht.alt, 
                      methylation_level=ht.methylation_level,
                      exome_coverage=ht.exome_coverage)

agg = {"variant_count": hl.agg.count()}

new_ht = ht.group_by(**grouping).partition_hint(n=100).aggregate(**agg)

ht.n_partitions()
new_ht.n_partitions()

```

---

<div class="post-metadata">

**Author:** ![patrick-schultz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/patrick-schultz/32/265_2.png) [@patrick-schultz](https://discuss.hail.is/u/patrick-schultz)\
**Post date:** [July 19, 2023, 2:17pm UTC](https://discuss.hail.is/t/no-change-with-partition-hint/3497/2 "2023-07-19T14:17:45Z")

</div>

Hi @klaricch,

Great question! This looks like a bug to me, and I think should be an easy fix.

Just to be clear on the context, this isn’t about repartitioning tables, it’s about how many partitions to use for the result of a group\_by and aggregate operation, which potentially can have many fewer rows.

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [July 27, 2023, 8:15pm UTC](https://discuss.hail.is/t/no-change-with-partition-hint/3497/3 "2023-07-27T20:15:54Z")

</div>

This fix will land in 0.2.120

---

<div class="post-metadata">

**Author:** ![klaricch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/klaricch/32/643_2.png) [@klaricch](https://discuss.hail.is/u/klaricch)\
**Post date:** [July 31, 2023, 1:46pm UTC](https://discuss.hail.is/t/no-change-with-partition-hint/3497/4 "2023-07-31T13:46:08Z")

</div>

OK, thank you!

---

<div class="post-metadata">

**Author:** ![klaricch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/klaricch/32/643_2.png) [@klaricch](https://discuss.hail.is/u/klaricch)\
**Post date:** [August 8, 2023, 3:30pm UTC](https://discuss.hail.is/t/no-change-with-partition-hint/3497/5 "2023-08-08T15:30:33Z")

</div>

I’ve updated to the most recent version of Hail, but I’m still having the same issues with partition hint
