omegaconf icon indicating copy to clipboard operation
omegaconf copied to clipboard

fix: `get_attr_data` doesn't handle default factory correctly

Open bzczb opened this issue 2 years ago • 3 comments

Motivation

get_attr_data() didn't check default values for "factory" types, which need to be called in order to get the real default value, so several use cases that worked with dataclasses were broken for attrs classes.

Test Plan

New fixture parameter added for "factory" variant of the tests/structured_conf/data/ attrs classes, similar to the post-Python 3.11 dataclass tests. New test added for error on takes_self parameter to factory (does not exist in dataclasses).

Fixes

Fixes #945 get_attr_data doesn't handle default factory correctly

bzczb avatar Oct 22 '23 20:10 bzczb

Hi, Is there an expected release date for this PR?

michaelvay avatar Jan 10 '24 09:01 michaelvay

Hi, Is there an expected release date for this PR?

No, there's no ETA yet for the next Hydra release.

odelalleau avatar Jan 10 '24 13:01 odelalleau

@Jasha10, good to merge?

omry avatar Jul 15 '24 11:07 omry