> For the complete documentation index, see [llms.txt](https://docs-lunar.earthly.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-lunar.earthly.dev/plugin-sdks/python-sdk/policy/no-data-error.md).

# NoDataError

Reference for the NoDataError exception that signals required component data is not yet collected, marking a Lunar check as pending.

The `NoDataError` exception is used to indicate that there is not enough data to make a determination on whether the check should pass or fail. This is due to the required data not having been collected yet and thus not being present in the component JSON.

This exception is automatically caught by the `Check` context manager, which sets the check status to `pending` if collectors are still running. Note that the `NoDataError` is unexpected after collectors finished, and will result in an `error` status.

The purpose of `NoDataError` is to distinguish between:

1. **Data is pending**: When required data is yet to be collected (for example, a CI collector hasn't triggered yet, or a code collector hasn't finished running yet)
2. **Failed Assertions**: When data is present but doesn't meet the policy requirements (results in `fail` status)

This distinction is important because Lunar re-evaluates policies as data becomes available. A `pending` status indicates that the policy should be re-evaluated when more data is collected, while a `fail` status indicates a definitive policy violation.

## Constructor

```python
NoDataError(message=None)
```

* **message** (str, optional): A message describing why the data is missing


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs-lunar.earthly.dev/plugin-sdks/python-sdk/policy/no-data-error.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
