You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bro
It looks like there is a type error occurring when trying to access a dictionary key as a string in the ocean_lib/ocean/ocean_compute.py module. Specifically, the get_free_c2d_environment function is attempting to access the "priceMin" key of a dictionary, but it is being treated as a string instead of an integer.
One possible solution is to convert the "priceMin" value to a float before accessing it as a dictionary key. Here's an example:
python
def get_free_c2d_environment(self) -> dict:
environments = self.compute_client.get_environments()
free_envs = [env for env in environments if float(env.get("priceMin", 0)) == 0.0]
if not free_envs:
raise Exception("No free environment found.")
return free_envs[0]
In this example, we use the get method of the dictionary to get the value of the "priceMin" key, with a default value of 0 if the key is not present. We then convert this value to a float before comparing it to 0.0.
Alternatively, you can modify the code that is passing in the dictionary to ensure that the "priceMin" key contains a float value instead of a string.
I hope this helps you to fix the issue with your code.
There is a provider issue [version of this issue]. #606 in provider
"Known issue: compute environments disappear in CI"
Unfortunately it's our main blocker for now, and we can't work on provider nor ocean.py due to this
Bug report
I made a simple one-paragraph change to a README, in this PR.
Yet in remote CI, four tests failed. All sub-tests of
test_compute_flow.py
:All four tests had the same failure:
Traceback
Full logs are here.
Here's one example traceback.
The text was updated successfully, but these errors were encountered: