# Run.history(keys=key\_list) returns empty history

**URL:** <https://community.wandb.ai/t/run-history-keys-key-list-returns-empty-history/3746>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [January 25, 2023, 1:16pm UTC](https://community.wandb.ai/t/run-history-keys-key-list-returns-empty-history/3746 "2023-01-25T13:16:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kolja](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@kolja](https://community.wandb.ai/u/kolja)\
**Post date:** [January 25, 2023, 1:16pm UTC](https://community.wandb.ai/t/run-history-keys-key-list-returns-empty-history/3746/1 "2023-01-25T13:16:40Z")

</div>

Hi everyone,

when calling `run.history(keys=key_list)` with a `key_list` that contains more than one key with a ‘/’ character in it, an empty history is returned:

```auto
history = run.history(keys=["hierarchy_1/metric_1", "hierarchy_1/metric_2"], samples=n_samples)
print(history)

```

yields this output:

```auto
Empty DataFrame
Columns: []
Index: []

```

However, calling it with only one key in the list yields the full history:

```auto
history_metric_1 = run.history(keys=["hierarchy_1/metric_1"], samples=n_samples)
history_metric_2 = run.history(keys=["hierarchy_1/metric_2"], samples=n_samples)

```

both work and return `n_samples` steps of the run history.

Calling `run.history()` without any keys and extracting them afterwards is not an option for me due to another bug in the API, discussed [here](https://community.wandb.ai/t/calling-run-history-samples-n-samples-returns-a-sample-size-different-from-n-samples/3414).

---

<div class="post-metadata">

**Author:** ![luis\_bergua](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@luis\_bergua](https://community.wandb.ai/u/luis_bergua)\
**Post date:** [January 26, 2023, 1:49pm UTC](https://community.wandb.ai/t/run-history-keys-key-list-returns-empty-history/3746/2 "2023-01-26T13:49:51Z")

</div>

Hi @kolja, thanks a lot for reporting this! I have checked this but it seems I am not getting the same behaviour as you do, by running a code like this:

```auto
import wandb

entity = entity_name
project = project_name

run = wandb.init(entity=entity, project=project)
for i in range(5):
  run.log({'hierarchy_1/metric_1':i, 'hierarchy_1/metric_2':1/(i+1)})
id = run.id
run.finish()

api = wandb.Api()
run = api.run(f'{entity}/{project}/{id}')
history = run.history(keys=["hierarchy_1/metric_1", "hierarchy_1/metric_2"], samples=5)
print(history)

```

I can see both metrics properly:

```auto
  _step hierarchy_1/metric_1 hierarchy_1/metric_2
0 0 0 1.000000
1 1 1 0.500000
2 2 2 0.333333
3 3 3 0.250000
4 4 4 0.200000

```

Could you please try this code and see if it works? Also, could you send me the link of the run and so I can have a look at it and see what type of data are you using because maybe this is affecting? Thanks

---

<div class="post-metadata">

**Author:** ![luis\_bergua](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@luis\_bergua](https://community.wandb.ai/u/luis_bergua)\
**Post date:** [January 30, 2023, 12:49pm UTC](https://community.wandb.ai/t/run-history-keys-key-list-returns-empty-history/3746/3 "2023-01-30T12:49:12Z")

</div>

Hi Kolja,

We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Best,  
Luis

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [March 27, 2023, 1:50pm UTC](https://community.wandb.ai/t/run-history-keys-key-list-returns-empty-history/3746/4 "2023-03-27T13:50:47Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
