Feature Group Versioning

Overview

Feature Group versioning in mloda provides a way to track changes, manage compatibility, and aid debugging. This document explains how the versioning system works and how it's used in feature groups.

Key Concepts

Composite Version Identifier

The version identifier is generated by combining: - The version of the 'mloda' package - The module name where the feature group is defined - A SHA-256 hash of the feature group class's source code

This creates a unique identifier that represents the implementation state of the feature group.

The BaseFeatureGroupVersion Class

The BaseFeatureGroupVersion class handles the versioning logic:

@classmethod
def version(cls) -> str:
    """
    Returns a composite version identifier for this feature group.
    """
    return BaseFeatureGroupVersion.version(cls)

Reading the mloda Package Version

Three supported programmatic paths, all backed by mloda.core.version.get_mloda_version():

from mloda.user import __version__          # also on mloda.provider and mloda.steward
from mloda.core.version import get_mloda_version
from mloda.provider import BaseFeatureGroupVersion

get_mloda_version()                          # memoized, "0.0.0" if not installed
BaseFeatureGroupVersion.mloda_version()      # same value

There is no mloda.__version__: mloda is a PEP 420 namespace root with no __init__.py, so plugin packages can add subpackages under it.

Benefits

  • Change Detection: Easily detect when a feature group implementation has changed
  • Compatibility Management: Ensure compatibility between different versions
  • Debugging: Trace issues back to specific implementations
  • Reproducibility: Recreate results with the same feature group version