Skip to content

Commit 314eb0e

Browse files
committed
Clean up: remove Python download scripts, fix linting
- Delete download-geojson.py and download-us-zipcodes.py (use shell script instead) - Fix ProjectContext: replace 'any' type with proper unknown type and type guard - Fix SqlLabPage: extract firstSavedQueryId variable for clean dependency tracking - All linting now passes: 0 errors, 0 warnings
1 parent 4015e2f commit 314eb0e

File tree

4 files changed

+11
-299
lines changed

4 files changed

+11
-299
lines changed

exec/java-exec/src/main/resources/webapp/scripts/download-geojson.py

Lines changed: 0 additions & 223 deletions
This file was deleted.

exec/java-exec/src/main/resources/webapp/scripts/download-us-zipcodes.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

exec/java-exec/src/main/resources/webapp/src/contexts/ProjectContext.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ export function ProjectContextProvider({
4343
queryKey: ['project', projectId],
4444
queryFn: () => getProject(projectId),
4545
enabled: !!projectId,
46-
retry: (failureCount, error: any) => {
46+
retry: (failureCount, error: unknown) => {
4747
// Don't retry 404s (project not found) immediately
4848
// Only retry on network errors or server errors (5xx)
49-
if (error?.response?.status === 404) {
50-
// Don't retry 404 errors
51-
return false;
49+
if (error && typeof error === 'object' && 'response' in error) {
50+
const httpError = error as { response?: { status?: number } };
51+
if (httpError.response?.status === 404) {
52+
// Don't retry 404 errors
53+
return false;
54+
}
5255
}
5356
// Retry up to 3 times for other errors
5457
return failureCount < 3;

exec/java-exec/src/main/resources/webapp/src/pages/SqlLabPage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,11 +537,12 @@ export default function SqlLabPage({ datasetFilter, headerContent, projectId, sa
537537
}, [locationState, updateSql, dispatch, activeTabId]);
538538

539539
// Load saved queries for the project
540+
const firstSavedQueryId = savedQueryIds?.[0];
540541
useEffect(() => {
541-
if (projectId && savedQueryIds && savedQueryIds.length > 0) {
542+
if (projectId && firstSavedQueryId) {
542543
// Import here to avoid circular dependency
543544
import('../api/savedQueries').then(({ getSavedQuery }) => {
544-
getSavedQuery(savedQueryIds[0])
545+
getSavedQuery(firstSavedQueryId)
545546
.then((query) => {
546547
updateSql(query.sql);
547548
if (query.defaultSchema) {
@@ -557,7 +558,7 @@ export default function SqlLabPage({ datasetFilter, headerContent, projectId, sa
557558
});
558559
});
559560
}
560-
}, [projectId, savedQueryIds?.[0], activeTabId, updateSql, dispatch]);
561+
}, [projectId, firstSavedQueryId, activeTabId, updateSql, dispatch]);
561562

562563
// Handle format SQL
563564
const handleFormat = useCallback(() => {

0 commit comments

Comments
 (0)