Skip to content

Allow custom env_prefixes to be used when initialising the SDK #999

@ianatkinson-ee

Description

@ianatkinson-ee

We want to be able to run the same script on multiple Looker instances, and so would need different env variables. We can do this by using different config files as the functions in https://github.com/looker-open-source/sdk-codegen/blob/main/python/looker_sdk/__init__.py have a config_file argument, but this means storing environment variables in code.

The env_prefix is currently not an option in those function arguments and is hardcoded as constants.environment_prefix. Can this be included as function arguments in the init31, init40 and _settings functions so that the env_prefixes can be changed? I.e. something like
def init31( config_file: str = "looker.ini", env_prefix=constants.environment_prefix, section: Optional[str] = None )

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature requestp3Priority 3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions