Feature Table

Classes

class databricks.ml_features.entities.feature_table.FeatureTable(name, table_id, description, primary_keys, partition_columns, features, creation_timestamp=None, online_stores=None, notebook_producers=None, job_producers=None, table_data_sources=None, path_data_sources=None, custom_data_sources=None, timestamp_keys=None, tags=None)

Note

Aliases:databricks.feature_engineering.entities.feature_table.FeatureTable, databricks.feature_store.entities.feature_table.FeatureTable

Value class describing one feature table.

This will typically not be instantiated directly, instead the create_table() will create FeatureTable objects.

Time Windows

class databricks.ml_features.entities.time_window.TimeWindow(*, duration: Optional[timedelta], delay: Optional[timedelta] = None, offset: Optional[timedelta] = None, _start_inclusive: bool = True, _end_inclusive: bool = False)

Bases: _FeatureStoreObject

Abstract base class for aggregation time windows.

Cannot be instantiated directly. Use one of the concrete subclasses: RollingWindow, TumblingWindow, or SlidingWindow.

Parameters
  • duration – The length of the time window. This defines how far back in time the window spans from the requested time. This must be positive. The interval defined by this window includes the start (earlier in time) endpoint, but not the end (later in time) endpoint. That is, the interval is [ts - duration, ts). None denotes a lifetime (infinite) window that spans all history.

  • delay – Non-negative analytic shift that evaluates the window this far in the past. Use it for timing variations unrelated to source lateness, such as a 30-day count as of one week ago. It composes with source lateness and defaults to zero.

  • offset – Non-negative phase shift from the default midnight UTC alignment for fixed window boundaries. Defaults to zero.

__init__(*, duration: Optional[timedelta], delay: Optional[timedelta] = None, offset: Optional[timedelta] = None, _start_inclusive: bool = True, _end_inclusive: bool = False)

Initialize a TimeWindow object. See class documentation.

property duration: Optional[timedelta]

The length of the time window, or None for a lifetime (infinite) window.

property delay: timedelta

The non-negative analytic shift applied independently of source lateness.

property offset: timedelta

The non-negative phase shift from midnight UTC for fixed boundaries.

property is_lifetime: bool

Whether this is a lifetime (infinite) window, i.e. it has no lower time bound.

class databricks.ml_features.entities.time_window.TumblingWindow(*, window_duration: timedelta, delay: Optional[timedelta] = None, offset: Optional[timedelta] = None)

Bases: TimeWindow

Tumbling windows partition a continuous stream of data into non-overlapping, fixed-duration windows. Each event belongs to exactly one window.

Example: 5-day tumbling creates windows [Day1-5], [Day6-10], [Day11-15]

Parameters
  • window_duration – The length of each time window. This must be positive.

  • delay – Non-negative analytic shift that evaluates the window this far in the past, independently of source lateness. Defaults to zero.

  • offset – Non-negative phase shift from midnight UTC. For example, a 22-hour offset on a 24-hour window produces boundaries at 22:00 UTC instead of midnight. Must be shorter than window_duration and defaults to zero.

__init__(*, window_duration: timedelta, delay: Optional[timedelta] = None, offset: Optional[timedelta] = None)

Initialize a TumblingWindow object. See class documentation.

class databricks.ml_features.entities.time_window.SlidingWindow(*, window_duration: Optional[timedelta], slide_duration: timedelta, delay: Optional[timedelta] = None, offset: Optional[timedelta] = None)

Bases: TimeWindow

Sliding windows create overlapping, fixed-duration windows that advance by a specified slide interval. Data points can belong to multiple windows.

Example: 5-day window, 1-day slide creates overlapping 5-day periods: [Day1-5], [Day2-6], [Day3-7], etc.

Parameters
  • window_duration – The length of each time window. This must be positive, or None for a lifetime (infinite) window.

  • slide_duration – The interval by which windows advance. This must be positive and less than window_duration.

  • delay – Non-negative analytic shift that evaluates the window this far in the past, independently of source lateness. Defaults to zero.

  • offset – Non-negative phase shift from midnight UTC. For example, a 22-hour offset on a 24-hour slide produces boundaries at 22:00 UTC instead of midnight. Must be shorter than slide_duration and defaults to zero.

__init__(*, window_duration: Optional[timedelta], slide_duration: timedelta, delay: Optional[timedelta] = None, offset: Optional[timedelta] = None)

Initialize a SlidingWindow object. See class documentation.

property slide_duration: timedelta

The interval by which windows advance.