Checking your account

You can read the lesson while its saved answers and constructions load. Learning controls will open once that work is ready.

Python Testing and Project Tools

Keep useful report logs

Coding challenges

BOTIE

Keep events at or above minimum_level, then return only the fields named in public_fields. Severity runs from DEBUG through INFO, WARNING, ERROR and CRITICAL. At WARNING, the first result should contain the warning and error, with their report IDs and messages but no private_token.
Ready to test
0 passed · 0 failed · 3 not run

An empty floor. Start with the information your machine needs.

Received result

Your answer will arrive here.

Examples, experiments and workspace controls
Live values

Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.

Try your own inputs

Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.

Start at an output arrow, then click or drag to an input. Drag empty space to pan. Delete removes a selection. Ctrl/Cmd+Z undoes a change.
Context for this challenge

Keep events at or above minimum_level, then return only the fields named in public_fields. Severity runs from DEBUG through INFO, WARNING, ERROR and CRITICAL. At WARNING, the first result should contain the warning and error, with their report IDs and messages but no private_token.

A useful diagnostic needs enough context to find the failure without copying the whole request.

Choose event severity marks entries at the selected level or higher. Keep those events, then select the allowed fields for each retained record.

Examples and results
Report events with private placeholders
  1. level
    INFO
    report_id
    R10
    message
    Report completed
    private_token
    placeholder only
  2. level
    WARNING
    report_id
    R11
    message
    No readings for south
    private_token
    placeholder only
  3. level
    ERROR
    report_id
    R12
    message
    Temperature field rejected
    private_token
    placeholder only
Least severe event to keep
WARNING
Fields allowed in the displayed log
  1. 0level
  2. 1report_id
  3. 2message
Required result
  1. level
    WARNING
    report_id
    R11
    message
    No readings for south
  2. level
    ERROR
    report_id
    R12
    message
    Temperature field rejected
Report events with private placeholders
  1. level
    INFO
    report_id
    R10
    message
    Report completed
    private_token
    placeholder only
  2. level
    WARNING
    report_id
    R11
    message
    No readings for south
    private_token
    placeholder only
  3. level
    ERROR
    report_id
    R12
    message
    Temperature field rejected
    private_token
    placeholder only
Least severe event to keep
INFO
Fields allowed in the displayed log
  1. 0level
  2. 1report_id
  3. 2message
Required result
  1. level
    INFO
    report_id
    R10
    message
    Report completed
  2. level
    WARNING
    report_id
    R11
    message
    No readings for south
  3. level
    ERROR
    report_id
    R12
    message
    Temperature field rejected
Report events with private placeholders
  1. level
    INFO
    report_id
    R10
    message
    Report completed
    private_token
    placeholder only
Least severe event to keep
CRITICAL
Fields allowed in the displayed log
  1. 0level
  2. 1report_id
  3. 2message
Required result
[]
Try a fresh construction

This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.

Stuck? Inspect a worked construction

The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.

Assumptions and test precision

The blocks filter local example records and do not send logs. Messages here contain approved event text; real exception messages can include private input and need separate review. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.

Routine progress without private fields

This check uses the pieces from “Select the events and their public fields”.

BOTIE

The minimum log level changes to INFO. Displayed fields are restricted to report_id and message, while each input event still has its private-token placeholder.
Report events with private placeholders
  1. level
    DEBUG
    report_id
    R20
    message
    Source selected
    private_token
    placeholder only
  2. level
    INFO
    report_id
    R20
    message
    Report completed
    private_token
    placeholder only
Least severe event to keep
INFO
Fields allowed in the displayed log
  1. 0report_id
  2. 1message
Should private_token appear in the displayed log?

Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

Could a message expose private input even after the token field is removed?

Review message content as well as which fields are included.

The blocks filter local example records and do not send logs. Messages here contain approved event text; real exception messages can include private input and need separate review.

Continue the courseProfiling and Optimization →
← Formatting, Linting, and Type Checks