Skip to content

[BUG] Using parse_config(file, tag="") does'nt work. #42

Open
@GBraL

Description

@GBraL

Describe the bug
When I don't use any suffix to specify the tag, the function does not convert the environment variables.

To Reproduce
Steps to reproduce the behavior:

  1. Provide a YAML example
    config.yaml
ENV:
  NAME: ${ENVIRONMENT:DEV}
  1. Run
    parse_config('./config.yaml', default_value="", tag=None)

  2. Results
    print(ENV.NAME)
    ${ENVIRONMENT:DEV}

Expected behavior (if os ENVIRONMENT variable not setted)
print(ENV.NAME)
DEV

Notes
If I use:

parse_config('./config.yaml', default_value="", tag=None)

It works, but according to Pylance rules I can't assign "None" to the tag attribute.

"Argument of type "None" cannot be assigned to parameter "tag" of type "str" in function "parse_config" "None" is not assignable to "str"Pylance"

Additional context
Add any other context about the problem here.

  • Python version - 3.311
  • OS - linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions