EX294 Transform data with filters and plugins Practice Question
A task sets a variable `raw_size` to the string `'2048'`. You need to pass this value to a module parameter that expects an integer. Which filter should be applied to `raw_size` to achieve the correct type?
⚠ Common exam trap
The trap here is reaching for `float` because it is numeric, when the parameter specifically requires an integer type.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
{{ raw_size | int }}
When a variable holds a numeric string and a module parameter requires an integer, the `int` filter performs the necessary conversion. Filters like `bool` and `string` do not change the value into an integer, and `float` produces a floating-point number that may not satisfy an integer parameter. Using `int` ensures the value is the correct type for the module.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
{{ raw_size | float }}
Why it's wrong here
`float` converts the string to a floating-point number such as 2048.0. While numeric, it is not an integer, and a module expecting an integer may reject the float or behave unexpectedly. For an integer parameter, `int` is the correct choice rather than `float`.
- ✗
{{ raw_size | bool }}
Why it's wrong here
`bool` converts values to boolean `True` or `False`, not to an integer. A non-empty string like `'2048'` becomes `True`, which is the wrong type and value for a parameter expecting a numeric size. This filter is used for conditional logic, not numeric conversion.
- ✓
{{ raw_size | int }}
Why this is correct
`int` converts the string `'2048'` into the integer 2048, satisfying the module parameter's numeric type requirement. It correctly handles numeric strings and produces a value usable in arithmetic or size comparisons. This is the appropriate filter for the stated scenario.
- ✗
{{ raw_size | string }}
Why it's wrong here
`string` ensures the value is a string, which is already the case for `raw_size`. It does not convert the string to an integer, so the module parameter would still receive a string and likely fail type validation. This filter is the opposite of what is needed here.
Go deeper
Related to this question
About these practice questions
This EX294 question is part of Courseiva's 392-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Red Hat exam blueprint
This EX294 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX294 exam.