MD_GET_FLIGHT_VERSION
Preview
This feature is in preview and is subject to change.
Returns the full content of a single FlightVersion. Use this when you need the source code or requirements that ran for a specific historical run.
Syntax
SELECT * FROM MD_GET_FLIGHT_VERSION(
flight_id := '<flight_id>',
version_number := <n>
);
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
flight_id | UUID | Yes | Identifier of the Flight. |
version_number | INTEGER | Yes | The version to fetch. Version numbers start at 1 and increment on each content update. |
Return columns
| Column | Type | Description |
|---|---|---|
flight_version | INTEGER | The version number. |
source_code | VARCHAR | The Python source as of this version. |
requirements_txt | VARCHAR | The requirements.txt contents as of this version. |
access_token_name | VARCHAR | The access token label as of this version. |
flight_secret_names | LIST(VARCHAR) | The secret names list as of this version. |
config | MAP(VARCHAR, VARCHAR) | The config map as of this version. |
created_at | TIMESTAMP WITH TIME ZONE | When this version was created. |
Behavior
Content fields that are not patched in an update carry forward from the previous version. For example, a source_code-only update on version 2 produces a version 3 where requirements_txt, config, access_token_name, and flight_secret_names match version 2 but source_code is the new value.
Examples
SELECT flight_version, source_code, requirements_txt
FROM MD_GET_FLIGHT_VERSION(
flight_id := '80000000-0000-0000-0000-000000000001',
version_number := 1
);
Cross-reference a run's version to read the exact source it executed:
WITH r AS (
SELECT flight_version
FROM MD_LIST_FLIGHT_RUNS(flight_id := '<flight_id>')
WHERE run_number = <n>
)
SELECT v.source_code, v.requirements_txt
FROM r, MD_GET_FLIGHT_VERSION(flight_id := '<flight_id>', version_number := r.flight_version) v;
Related
MD_LIST_FLIGHT_VERSIONS— List all versions for a Flight.MD_GET_FLIGHT— Fetch current summary metadata only.get_flightMCP tool — AI-agent equivalent (pass aversionargument).