Open skrawcz opened 3 months ago
I might be able to help with point (2.). Two questions:
It doesn't have to be config files vs CLI vs environment variables, it can be all of the above as well.
In a previous project I used pydantic to manage configuration, it used to be built into the package, now it is a plugin: https://docs.pydantic.dev/latest/concepts/pydantic_settings/
With pydantic-settings you can define a pydantic model for your settings, the values for the settings can automatically be read from:
You can define which settings sources you want to use and what should be their priority.
This is less simple than just reading env vars from os.environ but might be interesting to use as a more advanced case? I'm currently integrating hamilton into a project that uses this, I could create an example for the examples folder in this repo if you want.
I might be able to help with point (2.). Two questions:
- Is it ok to add another dependency (ruamel-yaml)?
- What are your plans regarding moving to pyproject.toml? I can take care of that if you want.
Sorry @Dev-iL forgot to respond here. For (1) we want Hamilton to be dependency light. So if anything an optional target is fine. For (2) Thanks for going ahead and doing that! 🙇 .
This is less simple than just reading env vars from os.environ but might be interesting to use as a more advanced case? I'm currently integrating hamilton into a project that uses this, I could create an example for the examples folder in this repo if you want.
@Riezebos Sure yes please. That would help ground the conversation here.
Note: I am expecting some differing opinions on approach here which relate to individual concerns and approaches. E.g. if you treat configuration like code, you should just make it Python code to simplify things...
Is your feature request related to a problem? Please describe. At some point, configuration, i.e. data that shapes the dataflow, or is used as input to the dataflow, needs to get to Hamilton some how.
In some circles this is a YAML file, in others it's code, in others it's command line arguments, etc.
We don't have a prescribed path to do this -- users would like our thoughts here.
Describe the solution you'd like We should have a user guide on this, that includes an example.
It should cover the following scenario that I think covers 80% of cases:
There are few ways to do this, so we should show:
This should then link to an example.
Describe alternatives you've considered N/A
Additional context