Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt

Use this file to discover all available pages before exploring further.

This gem runs in .

Overview

Filters models based on the provided filter condition.
The gem has a corresponding interactive gem example. See Interactive gem examples to learn how to run sample pipelines for this and other gems.

Parameters

ParameterDescriptionRequired
ModelInput Source on which the filter condition will be applied.True
Filter ConditionBooleanType column or boolean expression.True

Example

Assume you have the following weather prediction table.
DatePredictionTemperatureCelsiusHumidityPercentWindSpeedCondition
2025-03-01156510Sunny
2025-03-02177012Cloudy
2025-03-03166811Rainy
2025-03-0414729Sunny

Result

The follow table results when you use the following filter condition: DatePrediction > '2025-03-02'
DatePredictionTemperatureCelsiusHumidityPercentWindSpeedCondition
2025-03-03166811Rainy
2025-03-0414729Sunny

Filter vs Conditional gem

The Filter gem and the Conditional gem both evaluate conditions on a dataset, but they serve different purposes.

Key differences

Filter gemCondition gem
PurposeReduce dataRoute data
OutputsOne outputTwo or more outputs
BehaviorKeeps rows that match the condition and removes the restSends rows to different outputs based on conditions
RoutingNo routingYes (multiple paths)
Order mattersNoYes (first matching output wins)

When to use the Filter gem

Use Filter gem when you want to keep only the rows that match a condition and remove the rest. For example, using the condition OrderAmount > 1000, the Filter gem returns only the rows where OrderAmount is greater than 1000, and removes all other rows from the pipeline.

When to use the Condition gem

Use the Condition gem when you want to route rows to different paths based on conditions. For example, if out0 is configured with the condition OrderAmount > 1000 and out1 has no condition, then rows where OrderAmount is greater than 1000 are routed to out0, while all remaining rows are routed to out1.

Row-level vs dataset-level behavior

  • Filter gem always operates at the row level
  • Condition gem can operate at:
    • row level (e.g., OrderAmount > 1000)
    • dataset level (e.g., Count < threshold)

Summary

  • Filter gem → keeps what matches
  • Condition gem → decides where data goes
Use the Filter gem for simple filtering. Use the Conditional em when you need branching or control flow in your pipeline.