-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: add user guide on "configuration" + Hamilton #1047
Comments
I might be able to help with point (2.). Two questions:
ChatGPT overview of configuration files vs CLI vs environment variablesWhen configuring software for different types of runs, the choice between static configuration files, CLI (Command Line Interface) arguments, and environment variables depends on factors like flexibility, ease of use, security, and the environment in which the software operates. Here's an overview of the use cases for each: 1. Static Configuration Files
2. CLI Arguments
3. Environment Variables
Summary
In many cases, a combination of these methods is used to balance flexibility, security, and maintainability, with priority typically given in the order of CLI arguments > environment variables > configuration files for overrides. |
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. |
Sorry @Dev-iL forgot to respond here. For (1) we want Hamilton to be dependency light. So if anything an optional target is fine.
@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
The text was updated successfully, but these errors were encountered: