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
Describe the bug
In several places, the code attempts to check if a node is missing with a comparison + a conditional (eg x = "a" if node == "???" else "b"). This conditional breaks if the node value is a pandas DataFrame, as DataFrames implement additional __bool__ logic that prevents such a conditional (see: https://github.com/pandas-dev/pandas/blob/v1.2.2/pandas/core/generic.py#L1440-L1446).
To Reproduce
creating a DictConfig:
from pandas import DataFrame
from omegaconf import OmegaConf
kwargs = OmegaConf.create({"a": DataFrame()}, flags={"allow_objects": True})
when attempting to set an attribute of an existing config:
from pandas import DataFrame
from omegaconf import OmegaConf
c = OmegaConf.create()
c._set_flag("allow_objects", True)
c.a = DataFrame()
Expected behavior
when running creating DictConfig or setting a new attr, there should simply be an update to the config where the DF object is now included (assuming allow_object flag is set to True).
Additional context
OmegaConf version: master branch
Python version: 3.7.6
Operating system : ubuntu
Please provide a minimal repro
The text was updated successfully, but these errors were encountered:
Describe the bug
In several places, the code attempts to check if a node is missing with a comparison + a conditional (eg
x = "a" if node == "???" else "b"
). This conditional breaks if the node value is a pandas DataFrame, as DataFrames implement additional__bool__
logic that prevents such a conditional (see: https://github.com/pandas-dev/pandas/blob/v1.2.2/pandas/core/generic.py#L1440-L1446).To Reproduce
creating a DictConfig:
when attempting to set an attribute of an existing config:
Expected behavior
when running creating DictConfig or setting a new attr, there should simply be an update to the config where the DF object is now included (assuming allow_object flag is set to True).
Additional context
The text was updated successfully, but these errors were encountered: