Skip to main content

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

ParameterTypeRequiredDescription
flight_idUUIDYesIdentifier of the Flight.
version_numberINTEGERYesThe version to fetch. Version numbers start at 1 and increment on each content update.

Return columns

ColumnTypeDescription
flight_versionINTEGERThe version number.
source_codeVARCHARThe Python source as of this version.
requirements_txtVARCHARThe requirements.txt contents as of this version.
access_token_nameVARCHARThe access token label as of this version.
flight_secret_namesLIST(VARCHAR)The secret names list as of this version.
configMAP(VARCHAR, VARCHAR)The config map as of this version.
created_atTIMESTAMP WITH TIME ZONEWhen 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;