Databricks-ML-Pro Model Development Practice Question
A machine learning engineer is training a model using MLflow on Databricks and wants to ensure that the model's input schema is captured and enforced during inference. They are using the `mlflow.pyfunc` flavor. Which action should they take to enable schema enforcement?
⚠ Common exam trap
Many exam-takers confuse schema documentation (tags or artifacts) with schema enforcement (signature).
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
✓
Log the model with the `signature` parameter, specifying the input and output schema.
The correct way to enable schema enforcement is to log the model with a signature. This signature is stored with the model and used by MLflow's serving components to validate incoming data. Tags and artifacts do not provide runtime enforcement, and autologging does not enforce schemas during inference.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Log the model with the `signature` parameter, specifying the input and output schema.
Why this is correct
Providing a signature when logging the model with `mlflow.pyfunc.log_model` captures the expected input and output schema. This signature is used during inference to validate that the input data matches the expected schema, helping to prevent errors and ensuring consistency. It is the standard way to enable schema enforcement in MLflow.
- ✗
Save the schema as a separate artifact and load it manually in the inference code.
Why it's wrong here
Saving the schema as an artifact requires manual loading and validation in the inference code, which is error-prone and not integrated with MLflow's model serving. MLflow's built-in signature mechanism automatically handles this, so manual artifacts are unnecessary and less reliable.
- ✗
Use `mlflow.set_tag` to record the schema as a JSON string in the run's tags.
Why it's wrong here
Setting a tag with the schema does not enforce it during inference. Tags are metadata for search and organization, not for validation. While it documents the schema, it does not provide any runtime enforcement, so invalid data could still be passed to the model.
- ✗
Enable autologging for the specific framework, which automatically captures and enforces the schema.
Why it's wrong here
Autologging captures the schema if the framework supports it, but it does not enforce it during inference. Enforcement is only active when the signature is explicitly provided and the model is served via MLflow's serving tools. Autologging alone does not guarantee schema enforcement at inference time.
About these practice questions
Courseiva writes every Databricks-ML-Pro question from scratch — 300 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 Databricks exam blueprint
This Databricks-ML-Pro practice question is part of Courseiva's free Databricks 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 Databricks-ML-Pro exam.