CRMPipelineAction is the Pydantic model serialized as JSON and sent in the body of every POST /step request. It defines the complete action space available to the agent — from inspecting raw data and applying column-level transformations, to merging DataFrames, executing SQL, and finally submitting the cleaned pipeline for grading. Every field is declared on the model; fields irrelevant to the current action_type must be omitted or set to null — the server strips None values automatically when using model_dump_json(exclude_none=True).
Base Class
CRMPipelineAction extends openenv.core.env_server.Action, which itself extends Pydantic’s BaseModel. If the openenv package is not installed, the server falls back to a plain BaseModel stub, so the serialization contract is identical in both environments.
Type Definition
The following TypeScript-style interface gives you the full field surface at a glance:Fields
PipelineActionType
required
The type of operation to perform. This is the only required field and acts as the discriminator that determines which other fields the server expects. Must be one of the eight
PipelineActionType enum values. See the Enums reference for the complete list.string
The primary DataFrame name to operate on. Must exactly match one of the strings in
available_sources returned by the latest observation. Used by VIEW_SOURCE, PROFILE_SOURCE, STANDARDIZE_COLUMN, HANDLE_MISSING, DEDUPLICATE, and as the first join partner in MERGE_SOURCES.string
The secondary DataFrame name for
MERGE_SOURCES. Must also exist in available_sources. The two sources are merged on join_key using an outer join, and the result is written to output_table.string
The column name within
source to apply a column-level operation to. Required for STANDARDIZE_COLUMN and HANDLE_MISSING. Must match an actual column in the target DataFrame — the server raises a ValueError (surfaced as "Error: ..." in last_action_feedback) if the column does not exist.StandardizationStrategy
The transformation strategy for
STANDARDIZE_COLUMN. Required when action_type is STANDARDIZE_COLUMN. Ignored for all other action types. See StandardizationStrategy for value semantics.MissingStrategy
The null-handling strategy for
HANDLE_MISSING. Required when action_type is HANDLE_MISSING. See MissingStrategy for value semantics.DeduplicationStrategy
The deduplication heuristic for
DEDUPLICATE. Required when action_type is DEDUPLICATE. See DeduplicationStrategy for matching logic.string
The literal replacement string used when
missing_strategy is FILL_VALUE. Ignored for all other missing strategies. Provide an empty string "" to fill nulls with blanks rather than a visible placeholder — this is the correct approach for the phone and signup_date columns in Task 1 when values are unrecoverable.string
The column name to join on for
MERGE_SOURCES. The column must exist in both source and source2. The server normalizes the key values (.lower().strip()) before merging to handle case and whitespace inconsistencies between sources.ConflictRule
The conflict resolution strategy for overlapping non-key columns during
MERGE_SOURCES. Optional — defaults to COALESCE if omitted. See ConflictRule.string
The name of the DataFrame to submit as the pipeline’s final output for
SUBMIT_PIPELINE. Must exist in available_sources. The server captures self._sources[final_source] and passes it to the grader, which compares it against the hidden ground-truth snapshot.string
The raw SQL
SELECT query string for EXECUTE_SQL. The server loads every DataFrame in available_sources into an in-memory SQLite database using the source name as the table name, executes your query, and writes the result to output_table.string
The name under which the result DataFrame is registered in
available_sources after EXECUTE_SQL or MERGE_SOURCES. Once written, you can reference output_table in subsequent actions as a normal source name. If omitted for EXECUTE_SQL, the result is saved as "sql_output".Required Fields Per Action Type
The following table summarizes exactly which fields are required and which are optional for eachaction_type. Sending extra fields is harmless — they are silently ignored.
fallback_value is only meaningful when missing_strategy is FILL_VALUE. For FILL_MEAN and FILL_MODE it is ignored. For DROP_ROW it is also ignored.Usage Examples
JSON Serialization
When sending actions toPOST /step, use model_dump_json(exclude_none=True) to strip all None fields and produce a minimal, clean payload. This matches the server’s expected format and avoids validation noise from null fields irrelevant to the current action_type.
str, their values are already plain strings in the JSON output — no extra conversion is required.