lively-lunch-9285
03/31/2025, 9:17 PMConfig
for the flow. It's a lot of calls to self.
and some `assert`ions. I feel like this is what Pydantic is for.
Is there an easy way to
1. hydrate a dataclass or pydantic model
2. then store that on self.
3. and reference it in later steps
4. such that we still get autocompletion on self.cfg
(or whatever we call it)
5. without having to put a from my_utils import SpecialPydanticFlowConfig
in every step?ancient-application-36103
03/31/2025, 9:18 PMlively-lunch-9285
03/31/2025, 9:20 PMancient-application-36103
03/31/2025, 9:21 PMlively-lunch-9285
03/31/2025, 9:22 PMlively-lunch-9285
03/31/2025, 9:22 PMlively-lunch-9285
03/31/2025, 9:22 PMself.config
isn't known until runtime, so you don't get dropdown suggestions after the .
in self.config.
lively-lunch-9285
03/31/2025, 9:23 PMclass PydanticConfigFlow(FlowSpec):
config: MyConfigModel = Config("config", parser=pydantic_parser)
Then it'd work.lively-lunch-9285
03/31/2025, 9:24 PMmypy
might get mad.ancient-application-36103
03/31/2025, 9:24 PMlively-lunch-9285
03/31/2025, 9:25 PMlively-lunch-9285
03/31/2025, 9:25 PMancient-application-36103
03/31/2025, 9:26 PMcfg: ConfigSchema = self.config
print(cfg.id)
lively-lunch-9285
03/31/2025, 9:26 PMlively-lunch-9285
03/31/2025, 9:28 PMmetaflow
somehow support a generic type?
Like have self.config
be of type Config[T]
where T is the return type of parser
ancient-application-36103
03/31/2025, 9:29 PMlively-lunch-9285
03/31/2025, 9:29 PMlively-lunch-9285
03/31/2025, 9:36 PMdry-beach-38304
03/31/2025, 10:45 PMlively-lunch-9285
04/01/2025, 3:29 PM.
to access attributes on the self.config
dry-beach-38304
04/01/2025, 3:52 PMself.config
using both .
and []
notation. What error deos it give you (caveat: of course, with .
notation, the name after the dot needs to be a valid python identifier).refined-insurance-51213
04/02/2025, 8:37 PMlively-lunch-9285
04/03/2025, 4:56 PM