Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-feat-date-features
description: Expand a date or datetime field into year / month / day / day-of-week / quarter (+ hour) derived fields.
kind: operator
category: FEAT
operator: FEAT_DATE_FEATURES
type: reference
applies_to: process, compose, predict
examples_tags: [feature-engineering, time-series, pre-filter]

Feature operators write derived fields before filters run; no Response.Components.

Use when

Splits a date into year, month, day, day of week and quarter fields, so each part can be filtered, grouped or modelled.

Questions it answers:

  • Do orders differ by day of the week?
  • Is there a seasonal pattern by month across several years?

Use something else:

  • ATTR_DATE_PART when you need just one part of the date.
  • GROUP_DATE when you want results grouped by day, month or year.

Params

None; params is unused.

Inputs

field (required) — date or datetime.

Output

Derived fields prefixed by label (default the field name):

FieldRange
<prefix>_yearyear
<prefix>_month1..12
<prefix>_day1..31
<prefix>_dowISO 1..7, 1 = Monday, 7 = Sunday
<prefix>_quarter1..4
<prefix>_hour0..23 — datetime only

Contract

  • Types (field): date, datetime; any other scalar type is PULSE_FIELD_TYPE_UNSUPPORTED.
  • Weight: not read; a weight in force is skipped.
  • Streaming: streamable.

Gotchas

  • Null source or tz_field value → every output null.
  • dow is ISO (6 = Saturday, 7 = Sunday) of the LOCAL day; ignores week_start.
  • Local Saturdays out: FILTER_EXCLUDE on <prefix>_dow ["6"]; with tz_field each row reads its own zone.
  • Suffixes are dow / quarter (not day_of_week / is_weekend).
  • Zone-capable: a datetime reads the LOCAL clock (slot tz / tz_field → time_zone_field / time_zone → cohort default field → default → UTC). A date ignores zones (explicit refused).

See