CertSafari
    Snowflake SnowPro Advanced: MLOps Engineer (MLA-B01)· Lessons

    Domain 1 · Lesson 3/17

    Point-in-time training sets with ASOF lookups

    Ensure temporal integrity and feature consistency.

    13 min read
    4% of exam
    4 sources
    Published 20 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Build a leakage-free training set by pairing a spine timestamp with a feature view's timestamp_col in generate_training_set
    • Explain how the ASOF join picks a feature value for each spine row
    • Prove that a training set contains no feature values from after each label's time
    • Freeze a verified training set as an immutable, versioned Dataset

    Key concept

    Point-in-time (ASOF) lookup — For each spine row, the Feature Store returns the latest feature row for the same entity key whose timestamp is at or before that row's spine timestamp. Each label only sees feature values that already existed when the prediction would have been made.

    1.Why a training set needs a timestamp on every row

    Temporal leakage happens when a training row carries a feature value the model could not have known at prediction time. Take a churn label dated 1 March. If it is joined to a customer's activity count computed on 20 March, the model learns from the future. It looks excellent offline and then underperforms in production, where the future is never available. The fix is to anchor every training row to a moment in time and only allow feature values from before that moment.

    The anchor is the spine: a Snowpark DataFrame that holds the entity IDs, a timestamp, the label columns and any extra training columns. The spine timestamp is the time each prediction would have been made. The Feature Store fetches the requested features for each entity ID, as they stood at that row's timestamp. So the spine says *who* and *when*, and the feature views supply *what was known then*.

    The feature side needs a timestamp too. A feature view (managed or external) declares a timestamp_col that records when each feature row became valid. Without it the feature view has no history to search, so the lookup cannot be time-aware. A feature view that carries time-series features must name its timestamp column.

    Checkpoint 1 of 8· Check yourself

    You are building a churn training set. Each label row is dated the day the churn prediction would have been made. The Feature Store must not leak future activity into these rows. Which timestamp do feature values have to be at or before?

    Sources12

    2.How the ASOF join picks each feature value

    The Feature Store implements point-in-time correctness with an ASOF JOIN. For each spine row, it matches on the entity join key and then looks backwards in time: of all the feature rows for that key stamped at or before the spine timestamp, it keeps the latest one. Rows stamped after the spine timestamp are never candidates, which is what keeps future data out of the model.

    Two plausible-sounding alternatives behave differently. An equality join on timestamps would drop almost every row, because feature timestamps rarely equal label timestamps exactly. Replaying each feature table with Time Travel would only show the table's physical state at a past moment, and that is limited by retention. The ASOF join needs neither. It reads the timestamped history in the feature table and picks the right row per key.

    Checkpoint 2 of 8· Check yourself

    A teammate wants to prevent leakage by replaying each feature table with Time Travel at every label's timestamp. The spine passed to generate_training_set has a timestamp column, and each feature view defines timestamp_col. How does the Feature Store attach feature values to each spine row?

    Checkpoint 3 of 8· Exam question

    Which mechanism does the Snowflake Feature Store use when generate_training_set receives a spine_timestamp_col and feature views that define a timestamp_col?

    Sources34

    3.Calling generate_training_set without leaking

    generate_training_set adds feature values to the spine. The parameter that switches on the time-aware lookup is spine_timestamp_col. You must supply it for time-series features, because it is the column name that turns on the automatic point-in-time lookup. spine_label_cols marks the label columns. include_feature_view_timestamp_col decides whether the feature row's own timestamp is copied into the output.

    generate_training_set with a spine timestamp for point-in-time lookuppython
    training_set = fs.generate_training_set(
        spine_df=MySourceDataFrame,
        features=[registered_fv],
        save_as="data_20240101",                    # optional
        spine_timestamp_col="TS",                   # optional
        spine_label_cols=["LABEL1", "LABEL2"],      # optional
        include_feature_view_timestamp_col=False,   # optional
    )

    spine_timestamp_col names a column of the spine, such as LABEL_TS. It does not name the feature view's EVENT_TS. The feature view's timestamp was fixed when the feature view was registered with timestamp_col, and the join compares the two. Passing the feature column as the spine column compares feature time with itself, so nothing anchors the lookup to the label date.

    Three common wrong setups all leak. Leaving out spine_timestamp_col drops the point-in-time lookup, so labels are no longer pinned to their own dates. Calling read_feature_view and left-joining on CUSTOMER_ID attaches the current value to every historical label. The refresh schedule only controls when the feature table updates. It does not decide which past row a given label should see. Hand-rolled joins also lose the guarantee the Feature Store gives for free.

    Inference uses the same lookup. retrieve_feature_values takes a spine_df and a spine_timestamp_col, so batch scoring for a past date receives the feature values valid at that date, using the same logic that built the training set.

    Checkpoint 4 of 8· Fill the gap

    In this call, "TS" is the spine column holding the time each prediction would have been made. Which parameter name in the blank turns on the point-in-time lookup?

    training_set = fs.generate_training_set(
        spine_df=MySourceDataFrame,
        features=[registered_fv],
        save_as="data_20240101",                    # optional
         ? ="TS",                   # optional
        spine_label_cols=["LABEL1", "LABEL2"],      # optional
        include_feature_view_timestamp_col=False,   # optional
    )

    Checkpoint 5 of 8· Exam question

    A data scientist is building a churn model. The spine DataFrame holds CUSTOMER_ID, LABEL_TS (the date each prediction would have been made) and CHURNED. The customer_activity feature view was registered with timestamp_col="EVENT_TS". Which call builds a training set that avoids temporal leakage?

    Sources1

    4.Proving that no future values leaked in

    A point-in-time training set can be checked row by row, and you should check it before you trust a new feature view. Set include_feature_view_timestamp_col=True so each output row keeps the timestamp of the feature row that was matched. Then assert that this feature timestamp is less than or equal to the spine timestamp on every row. A single row where the feature timestamp is later than the spine timestamp is proof of leakage.

    A second test uses a crafted spine. Pick one entity whose feature history you know, and add spine rows just before and just after a known feature update. The row before the update must return the old value. The row after must return the new one. If the earlier row already shows the new value, the lookup is reaching forward. One common cause is a feature view registered without timestamp_col, which leaves the lookup nothing to compare against.

    Checkpoint 6 of 8· Check yourself

    Before trusting a new feature view, you want proof that no training row picked up a feature value from after its prediction moment. Which test gives that proof row by row?

    Sources1

    5.Freezing a checked training set as a Dataset

    A leakage-checked training set is only reproducible if you materialize it in a form that cannot change. Managed feature views keep refreshing from new source data. Rerunning the same generate_training_set call in three months can therefore return different values, because the inputs to the lookup will have changed. Saving the query text does not freeze the data.

    Where a point-in-time training set can live, and whether it stays fixed
    OutputHow you get itFixed for later retraining?
    Snowpark DataFramegenerate_training_set without save_asNo: ephemeral, not materialized
    Tablegenerate_training_set with save_asNo: immutability not guaranteed, limited metadata
    Snowflake Datasetgenerate_dataset with name and versionYes: immutable, file-based snapshot

    generate_dataset takes the same spine and timestamp arguments plus a required name and an optional version, and it always materializes the result. The output is a Snowflake Dataset (a versioned, immutable snapshot). An auditor's "retrain on exactly the same rows" request then comes down to reading that version again.

    Freezing a point-in-time training set as a named, versioned Datasetpython
    dataset: Dataset = fs.generate_dataset(
        name="MY_DATASET",
        spine_df=MySourceDataFrame,
        features=[registered_fv],
        version="v1",                               # optional
        spine_timestamp_col="TS",                   # optional
        spine_label_cols=["LABEL1", "LABEL2"],      # optional
        include_feature_view_timestamp_col=False,   # optional
        desc="my new dataset",                      # optional
    )

    Registering a new feature view version after every refresh does not solve this. Feature view versions exist for changed definitions: features and columns cannot be modified in place, so a new version is how you change them. A new version does not snapshot data. The Dataset version is the snapshot.

    Checkpoint 7 of 8· Match them up

    An auditor may later ask you to retrain on exactly the same rows. Match each way of producing or versioning the training data to what it actually gives you.

    Tap a term, then the definition that fits it.

    Checkpoint 8 of 8· Exam question

    An auditor asks a team to retrain a fraud model three months from now on exactly the same training rows. The feature views are managed and keep refreshing from new source data. What should the team do when producing the training data today?

    Sources12

    Sources

    (4)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Requested features are retrieved for the list of entity IDs, with point-in-time correctness with respect to the provided time stamp.”
      ↩︎ Why a training set needs a timestamp on every row
      “For time-series features, provide the timestamp column name to automate the point-in-time feature value lookup.”
      ↩︎ Calling generate_training_set without leaking
      “include the timestamp column from the feature view by setting include_feature_view_timestamp_col”
      ↩︎ Proving that no future values leaked in
      “Snowflake Datasets provide an immutable, file-based snapshot of data, which helps to ensure model reproducibility”
      ↩︎ Freezing a checked training set as a Dataset
      “Requested features are retrieved for the list of entity IDs, with point-in-time correctness with respect to the provided time stamp.”
      ↩︎ Exam trap 1
      “Materialized tables currently don’t guarantee immutability and have limited metadata support.”
      ↩︎ Exam trap 2
      “Materialized tables currently don’t guarantee immutability and have limited metadata support. If you require these features, consider using Snowflake Datasets instead.”
      ↩︎ Checkpoint
    2. 2.
      “A timestamp column name is required if your feature view includes time-series features.”
      ↩︎ Why a training set needs a timestamp on every row
      “Feature definitions and columns cannot be modified. To change the features in a feature store, create a new version of the feature view.”
      ↩︎ Freezing a checked training set as a Dataset
    3. 4.
      “preventing future data from leaking into the model”
      ↩︎ How the ASOF join picks each feature value
      “selects the most recent snapshot row for each entity key at or before the spine timestamp”
      ↩︎ Key concept
      “selects the most recent snapshot row for each entity key at or before the spine timestamp”
      ↩︎ Prediction

    Continue to part 2 of 2

    Offline/online and Dev/Prod feature consistency

    Spotted a mistake, or was something unclear? Tell us.