Materialise SettingDefinition `aliases` in plugin env context
What is the current bug behavior?
What is happening now?
Currently adding a setting alias (using the aliases
attribute) does not create a corresponding environment variable in the plugins environment (of the form <PLUGIN_NAME>_<ALIAS_NAME>
) as is done for the unaliased setting name (i.e. <PLUGIN_NAME>_<SETTING_NAME>
).
This behaviour removes our ability to effectively rename superficial differences of plugin variant setting names, by removing the possibility of downstream plugins referencing the standardised form. Previously this was accomplished using env_aliases
, which are being deprecated #3120 (closed).
What is the expected correct behavior?
What should be happening?
The following SettingDefinition (from target-snowflake
transferwise variant):
- name: default_target_schema
label: Default Target Schema
aliases: [schema]
should result in two environment variables created in the plugins context:
TARGET_SNOWFLAKE_DEFAULT_TARGET_SCHEMA # created from the setting name
TARGET_SNOWFLAKE_SCHEMA # created from the alias name
Steps to reproduce
How one can reproduce the issue?
meltano add loader target-snowflake --variant=transferwise
# edit plugin settings to add alias (see below)
meltano --log-level=debug invoke target-snowflake
# view the outputted env vars from debug logs to verify alias env var `TARGET_SNOWFLAKE_SCHEMA` does not exist
plugins:
loaders:
- name: target-postgres
variant: transferwise
pip_url: pipelinewise-target-postgres
- name: target-snowflake
variant: transferwise
pip_url: pipelinewise-target-snowflake
settings:
- name: default_target_schema
aliases: [schema]
Relevant logs and/or screenshots
Please use code blocks (```) to format console output
Possible fixes
If you can, link to the line of code that might be responsible for the problem or suggest a fix
Further regression test
Ensure we automatically catch similar issues in the future
-
Write additional adequate test cases and submit test results -
Test results should be reviewed by a person from the team