# Lineage Diff

{% hint style="info" %}

* This feature is available with the [**Paradime Bolt plan**](https://www.paradime.io/pricing)**.**
* Your API keys ***must*** have either [Bolt Schedules Admin or Bolt Schedules Metadata Viewer](https://docs.paradime.io/app-help/developers/generate-api-keys) capabilities.
  {% endhint %}

The Lineage Diff module allows you to easily interact with [Paradime Lineage Diff](https://docs.paradime.io/app-help/documentation/bolt/ci-cd/lineage-diff) feature to trigger, generate and return column level lineage reports.

### Trigger Lineage Diff report and wait until report is returned

Triggers a lineage diff report for the specified parameters and waits until generation is completed.

{% tabs %}
{% tab title="Args" %}
**`bolt_run_id`** *`(int)`*: The ID of the completed Turbo CI bolt run.

**`pull_request_number`** *`(int)`*: The number of the pull request.

**`user_email`** *`(str)`*: The email of the user triggering the report (pull request author).

**`changed_file_paths`** *`(List[str])`*: A list of file paths that have changed in the pull request.

**`timeout`** *`(int, optional)`*: Maximum time in seconds to wait for the report to be available. Defaults to `3600`.
{% endtab %}

{% tab title="Returns" %}
*`Report`*: The lineage diff report.
{% endtab %}
{% endtabs %}

```python
# First party modules
from paradime import Paradime

# Create a Paradime client with your API credentials
paradime = Paradime(api_endpoint="API_ENDPOINT", api_key="API_KEY", api_secret="API_SECRET")

# Replace with all the arguments to generate the lineage diff report
BOLT_RUN_ID = 12345
PULL_REQUEST_NUMBER = 24
USER_EMAIL = "john@acme.io"
CHANGED_FILES = ["dbt/models/marts/core/order_items.sql", "dbt/models/marts/core/new_model.sql"]

# Trigger lineage diff report and wait until completed
report = paradime.lineage_diff.trigger_report_and_wait(
    bolt_run_id=BOLT_RUN_ID,
    pull_request_number=PULL_REQUEST_NUMBER,
    user_email=USER_EMAIL,
    changed_file_paths=CHANGED_FILES,
)
```

### Report object details

The `report` object provides several options that can be selected with the following attributes:

* `message`: A string containing details of the report status.
* `status`: Indicates the status of the operation or request.
* `url`: A string representing a URL to the Bolt schedule compiling the two git branches.
* `uuid`: A unique identifier for the report.
* `result_json`: Contains the result in JSON format.
* `result_markdown`: Provides the result in Markdown format.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paradime.io/app-help/developers/python-sdk/modules/lineage-diff.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
