lamindb.core.Settings

class lamindb.core.Settings(git_repo)

Bases: object

Settings.

Use lamindb.settings instead of instantiating this class yourself.

Attributes

artifact_use_virtual_keys: bool = True

Treat key parameter in Artifact as virtual.

If True, the key is not used to construct file paths, but file paths are based on the uid of artifact.

silence_file_run_transform_warning: bool = False

Silence warning about missing run & transform during file creation.

storage

Default storage location (a path to its root).

Examples:

You can switch to another managed storage location via:

>>> ln.settings.storage = "s3://some-bucket"

You can also pass additional fsspec kwargs via:

>>> kwargs = dict(
>>>     profile="some_profile", # fsspec arg
>>>     cache_regions=True # fsspec arg for s3
>>> )
>>> ln.settings.storage = "s3://some-bucket", kwargs
storage_local

An additional local default storage (a path to its root).

Is only available if keep_artifacts_local is enabled.

Guide: Keep artifacts local in a cloud instance

Shortcut for: ln.setup.settings.instance.storage_local.root

sync_git_repo

Sync transforms with scripts in git repository.

Provide the full git repo URL.

track_run_inputs: bool = True

Track files as input upon .load(), .cache() and .backed().

Requires a global run context with track() was created!

FAQ: Can I disable tracking run inputs?

transform

Transform settings.

upon_artifact_create_if_hash_exists: Literal['warn_return_existing', 'error', 'warn_create_new'] = 'warn_return_existing'

Behavior if file hash exists (default "warn_return_existing").

One of ["warn_return_existing", "error", "warn_create_new"].

FAQ: What happens if I save the same artifacts & records twice?

upon_create_search_names: bool = True

To speed up creating Registry objects (default True).

If True, search for alternative names.

FAQ: What happens if I save the same artifacts & records twice?

upon_file_create_skip_size_hash: bool = False

To speed up registering high numbers of files (default False).

This bypasses queries for size and hash to AWS & GCP.

It speeds up file creation by about a factor 100.

verbosity

Logger verbosity (default ‘warning’).

  • ‘error’: ❌ only show error messages

  • ‘warning’: ❗ also show warning messages

  • ‘success’: ✅ also show success and save messages

  • ‘info’: 💡 also show info messages

  • ‘hint’: 💡 also show hint messages

  • ‘debug’: 🐛 also show detailed debug messages

Methods