flytekit.configuration.file
0.1.dev2192+g7c539c3.d20250403
flytekit.configuration.file
Property
Type
Description
FLYTECTL_CONFIG_ENV_VAR
str
FLYTECTL_CONFIG_ENV_VAR_OVERRIDE
str
def bool_transformer (
config_val: typing. Any,
) -> bool
Parameter
Type
config_val
typing.Any
def comma_list_transformer (
config_val: typing. Any,
)
Parameter
Type
config_val
typing.Any
def int_transformer (
config_val: typing. Any,
)
Parameter
Type
config_val
typing.Any
def read_file_if_exists (
filename: typing. Optional[str],
encoding,
) -> n: The contents of the file as a string or None .
Reads the contents of the file if passed a path. Otherwise, returns None.
Parameter
Type
filename
typing.Optional[str]
encoding
def set_if_exists (
d: dict,
k: str,
v: typing. Any,
) -> dict
Given a dict d
sets the key k
with value of config v
, if the config value v
is set
and return the updated dictionary.
The input dictionary d
will be mutated.
Parameter
Type
d
dict
k
str
v
typing.Any
A top level Config entry holder, that holds multiple different representations of the config.
Legacy means the INI style config files. YAML support is for the flytectl config file, which is there by default
when flytectl starts a sandbox
class ConfigEntry (
legacy: LegacyConfigEntry,
yaml_entry: typing. Optional[YamlConfigEntry],
transform: typing. Optional[typing. Callable[[str], typing. Any]],
)
Parameter
Type
legacy
LegacyConfigEntry
yaml_entry
typing.Optional[YamlConfigEntry]
transform
typing.Optional[typing.Callable[[str], typing.Any]]
Method
Description
read()
Reads the config Entry from the various sources in the following order,.
def read (
cfg: typing. Optional[ConfigFile],
) -> n:
Reads the config Entry from the various sources in the following order,
#. First try to read from the relevant environment variable,
#. If missing, then try to read from the legacy config file, if one was parsed.
#. If missing, then try to read from the yaml file.
The constructor for ConfigFile currently does not allow specification of both the ini and yaml style formats.
Parameter
Type
cfg
typing.Optional[ConfigFile]
class ConfigFile (
location: str,
)
Load the config from this location
Parameter
Type
location
str
def get (
c: typing. Union[LegacyConfigEntry, YamlConfigEntry],
) -> typing. Any
Parameter
Type
c
typing.Union[LegacyConfigEntry, YamlConfigEntry]
Property
Type
Description
legacy_config
yaml_config
Creates a record for the config entry. contains
class LegacyConfigEntry (
section: str,
option: str,
type_: typing. Type,
)
Parameter
Type
section
str
option
str
type_
typing.Type
def read_from_env (
transform: typing. Optional[typing. Callable],
) -> n:
Reads the config entry from environment variable, the structure of the env var is current
FLYTE_{SECTION}_{OPTION}
all upper cased. We will change this in the future.
:return:
Parameter
Type
transform
typing.Optional[typing.Callable]
def read_from_file (
cfg: ConfigFile,
transform: typing. Optional[typing. Callable],
) -> typing. Optional[typing. Any]
Parameter
Type
cfg
ConfigFile
transform
typing.Optional[typing.Callable]
Creates a record for the config entry.
class YamlConfigEntry (
switch: str,
config_value_type: typing. Type,
)
Parameter
Type
switch
str
config_value_type
typing.Type
def read_from_file (
cfg: ConfigFile,
transform: typing. Optional[typing. Callable],
) -> typing. Optional[typing. Any]
Parameter
Type
cfg
ConfigFile
transform
typing.Optional[typing.Callable]