pierrejeambrun commented on code in PR #76747:
URL: https://github.com/apache/airflow/pull/76747#discussion_r4515133867
##########
providers/common/ai/src/airflow/providers/common/ai/plugins/www/src/model-api.ts:
##########
@@ -79,20 +88,19 @@ export function createModelApi(
region?: TaskRegion,
) {
return {
- fetchModelName: () =>
- fetchXComValue<string>(dagId, runId, taskId, mapIndex,
MODEL_NAME_XCOM_KEY, region),
- fetchUsage: async () => {
+ fetchModelName: async (): Promise<string | OffloadedValue | null> => {
+ const value = await fetchXComValue<string>(dagId, runId, taskId,
mapIndex, MODEL_NAME_XCOM_KEY, region);
+ // A reference is a string too, but a model name never holds a URI
scheme.
Review Comment:
I'm not able to find a tighter check that will work with custom backend. I
thought about checking `/${dagId}/${runId}/${taskId}/` but this could break
with custom backend.
I'll drop the 'never' for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]