bbovenzi commented on code in PR #24623: URL: https://github.com/apache/airflow/pull/24623#discussion_r906080330
########## airflow/www/static/js/grid/api/useTaskLog.tsx: ########## @@ -17,23 +17,31 @@ * under the License. */ -import axios from 'axios'; +import axios, { AxiosResponse } from 'axios'; import { useQuery } from 'react-query'; import { getMetaValue } from '../../utils'; const taskLogApi = getMetaValue('task_log_api'); const useTaskLog = ({ - dagId, dagRunId, taskId, taskTryNumber, fullContent, enabled, + dagId, dagRunId, taskId, taskTryNumber, fullContent, +}: { + dagId: string, + dagRunId: string, + taskId: string, + taskTryNumber: number, + fullContent: boolean, }) => { - const url = taskLogApi.replace('_DAG_RUN_ID_', dagRunId).replace('_TASK_ID_', taskId).replace(/-1$/, taskTryNumber); + let url: string = ''; + if (taskLogApi) { + url = taskLogApi.replace('_DAG_RUN_ID_', dagRunId).replace('_TASK_ID_', taskId).replace(/-1$/, taskTryNumber.toString()); + } - return useQuery( + return useQuery<string, Error>( Review Comment: Let's avoid setting any types directly on `useQuery` I think I accidentally have it on `useTasks()` which I'll fix -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org