foundry_dev_tools.config.config module#

Classes and logic for the Configuration.

class foundry_dev_tools.config.config.Config[source]#

Bases: object

Initialize the configuration.

Parameters:
  • requests_ca_bundle – a path to a CA bundle if requests needs custom certificates to work e.g. in a corporate network

  • transforms_sql_dataset_size_threshold – only download the complete dataset if it doesn’t exceed this threshold otherwise only return a smaller number of rows, set by transforms_sql_sample_row_limit

  • transforms_sql_sample_row_limit – Number of sql rows to return when the dataset is above the transforms_sql_dataset_size_threshold

  • transforms_sql_sample_select_random – set to true if the sample rows should be random (query will take more time)

  • transforms_force_full_dataset_download – if true, ignores the transforms_sql_dataset_size_threshold and downloads the full dataset

  • cache_dir – path to the cache dir for downloaded datasets, default is user_cache

  • transforms_freeze_cache – if this setting is enabled, transforms will work offline if the datasets are already in cache

  • transforms_output_folder – When @transform in combination with TransformOutput.filesystem() is used, files are written to this folder.

  • rich_traceback – enables a prettier traceback provided by the module rich See: https://rich.readthedocs.io/en/stable/traceback.html

  • debug – enables debug logging

__init__(requests_ca_bundle=None, transforms_sql_sample_row_limit=5000, transforms_sql_dataset_size_threshold=500, transforms_sql_sample_select_random=False, transforms_force_full_dataset_download=False, cache_dir=None, transforms_freeze_cache=False, transforms_output_folder=None, rich_traceback=False, debug=False)[source]#

Initialize the configuration.

Parameters:
  • requests_ca_bundle (PathLike[str] | None) – a path to a CA bundle if requests needs custom certificates to work e.g. in a corporate network

  • transforms_sql_dataset_size_threshold (int) – only download the complete dataset if it doesn’t exceed this threshold otherwise only return a smaller number of rows, set by transforms_sql_sample_row_limit

  • transforms_sql_sample_row_limit (int) – Number of sql rows to return when the dataset is above the transforms_sql_dataset_size_threshold

  • transforms_sql_sample_select_random (bool) – set to true if the sample rows should be random (query will take more time)

  • transforms_force_full_dataset_download (bool) – if true, ignores the transforms_sql_dataset_size_threshold and downloads the full dataset

  • cache_dir (PathLike[str] | None) – path to the cache dir for downloaded datasets, default is user_cache

  • transforms_freeze_cache (bool) – if this setting is enabled, transforms will work offline if the datasets are already in cache

  • transforms_output_folder (PathLike[str] | None) – When @transform in combination with TransformOutput.filesystem() is used, files are written to this folder.

  • rich_traceback (bool) – enables a prettier traceback provided by the module rich See: https://rich.readthedocs.io/en/stable/traceback.html

  • debug (bool) – enables debug logging

Return type:

None

foundry_dev_tools.config.config.get_config_dict(profile=None, env=True)[source]#

Loads config from the config files and environment variables.

Profiles make configs like this possible:

[config]
example_option = 1

[integration.config]
example_option = 2

Where ‘integration.config’ will be loaded instead of ‘config’ if the profile is set to integration.

Parameters:
  • profile (str | None) – The profile to use, if None the default profile is used

  • env (bool) – Whether to load the environment variables

Return type:

dict | None

foundry_dev_tools.config.config.parse_credentials_config(config_dict)[source]#

Parses the credentials config dictionary and returns a TokenProvider object.

Parameters:

config_dict (dict | None)

Return type:

TokenProvider

foundry_dev_tools.config.config.parse_general_config(config_dict=None)[source]#

Parses the config dictionary and returns a Config object.

Parameters:

config_dict (dict | None)

Return type:

Config