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

Pandas deprecation warning when deserializing AxClient JSON #2358

Closed
parrangoiz opened this issue Apr 12, 2024 · 2 comments
Closed

Pandas deprecation warning when deserializing AxClient JSON #2358

parrangoiz opened this issue Apr 12, 2024 · 2 comments
Assignees

Comments

@parrangoiz
Copy link

Hi! I'm a new user of Ax and I'm loving the framework, thanks for making this open to everyone! I've been using the Service API to run experiments and save intermediate snapshots to JSON. When deserializing, I get a deprecation warning (emitted by Pandas I believe). I'm using Ax 0.3.7. Here's a simple repro:

from ax.service.ax_client import AxClient
from ax.service.utils.instantiation import ObjectiveProperties

ax_client = AxClient(verbose_logging=False)
ax_client.create_experiment(
    name="test",
    parameters=[{"name": "x", "type": "range", "bounds": [0.0, 1.0]}],
    objectives={"f": ObjectiveProperties(minimize=True)},
)

for i in range(5):
    parameters, trial_index = ax_client.get_next_trial()
    data = {"f": parameters["x"] ** 2}
    ax_client.complete_trial(trial_index=trial_index, raw_data=data)

ax_client.save_to_json_file("test.json")
restored_client = AxClient.load_from_json_file("test.json")

Output:

[Standard information messages]
.../ax/core/data.py:203: FutureWarning: Passing literal json to 'read_json' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.

Seems fairly straightforward, I'd be happy to attempt to fix it unless this is already in the works. I'm not familiar with the codebase yet though, so not sure if there are other places this would have to change other than the offending line in core.data.

@Cesar-Cardoso Cesar-Cardoso self-assigned this Apr 16, 2024
@Cesar-Cardoso
Copy link
Contributor

Hello there! Thanks for flagging this. This is a known issue that's been addressed in #2346. It'll go away with the next release of Ax.

@parrangoiz
Copy link
Author

Oops, missed that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants