Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ax/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def __init__(
self._data_rows = [
DataRow(
# pyre-ignore[16] Intentional unsafe namedtuple access
trial_index=row.trial_index,
# int() cast needed because pd.read_json with dtype=False
# can return string trial indices from storage
trial_index=int(row.trial_index),
# pyre-ignore[16] Intentional unsafe namedtuple access
arm_name=row.arm_name,
# pyre-ignore[16] Intentional unsafe namedtuple access
Expand Down
3 changes: 3 additions & 0 deletions ax/storage/sqa_store/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,9 @@ def data_from_sqa(self, data_sqa: SQAData) -> Data:
# NOTE: Need dtype=False, otherwise infers arm_names like
# "4_1" should be int 41.
df = pd.read_json(StringIO(data_sqa.data_json), dtype=False)
# Ensure trial_index is int (dtype=False can leave it as string)
if "trial_index" in df.columns:
df["trial_index"] = df["trial_index"].astype(int)
if "metric_signature" not in df.columns:
df["metric_signature"] = df["metric_name"]

Expand Down