Skip to content

Conversation

@Xiaoming-AMD
Copy link
Collaborator

@Xiaoming-AMD Xiaoming-AMD commented Apr 23, 2025

enhance replace_env_variables: support numeric string auto-conversion

  • Improved env var substitution logic to automatically convert numeric strings to int or float:
    • ${PORT:8080} → 8080 (int)
    • ${RATIO:0.75} → 0.75 (float)
  • Used regex matching to detect and convert pure numeric strings after substitution.
  • Ensures cleaner config loading when numeric values are passed via environment variables.

Copy link
Contributor

@wenxie-amd wenxie-amd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenxie-amd wenxie-amd merged commit db0b063 into main Apr 23, 2025
2 checks passed
@Xiaoming-AMD Xiaoming-AMD deleted the dev/xiaoming/argument_from_env branch April 23, 2025 03:12
@Xiaoming-AMD Xiaoming-AMD changed the title [Feat] replace yaml value(int/float ) from env('KEY') feature(config parse): replace yaml value(int/float ) from env('KEY') Jun 4, 2025
@Xiaoming-AMD Xiaoming-AMD changed the title feature(config parse): replace yaml value(int/float ) from env('KEY') feat(config parse): replace yaml value(int/float ) from env('KEY') Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants