Skip to content

feat: Treat dotenv null values (e.g. ENV_VAR without a value) not as missing, but as "unsetting" #9785

@edgarrmondragon

Description

@edgarrmondragon

Meltano Version

4.0.9

Python Version

NA

Bug scope

Configuration (settings parsing, validation, etc.)

Operating System

NA

Description

The dotenv_values function from the python-dotenv package can be set to None[^1]:

Variable without a value

A variable can have no value:

FOO

It results in dotenv_values associating that variable name with the value
None (e.g. {"FOO": None}. load_dotenv, on the other hand, simply ignores
such variables.

This shouldn't be confused with FOO=, in which case the variable is associated
with the empty string.

This means that if we have the following meltano.yml and .env

plugins:
  extractors:
  - name: tap-pypistats
    variant: edgarrmondragon
    pip_url: tap-pypistats
    config:
      packages:
      - tap-$TAP_NAME
TAP_NAME

produce this behavior during env var expansion

$ meltano --log-level warning config print tap-pypistats
{
  "packages": [
    "tap-None"
  ]
}

Decision

Related

Code

plugins:
  extractors:
  - name: tap-pypistats
    variant: edgarrmondragon
    pip_url: tap-pypistats
    config:
      packages:
      - tap-$TAP_NAME

Link to Slack/Linen

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Fix.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions