Spaces:
Running
Running
Daniel Wiesmann commited on
Commit ·
11e0d81
1
Parent(s): df4a3f3
Fix lint: remove unused math import, move imports before constants in sql.py
Browse files- src/gazet/api.py +0 -1
- src/gazet/sql.py +6 -6
src/gazet/api.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import json
|
| 2 |
import logging
|
| 3 |
-
import math
|
| 4 |
import uuid
|
| 5 |
from contextlib import asynccontextmanager
|
| 6 |
from typing import Any, Generator
|
|
|
|
| 1 |
import json
|
| 2 |
import logging
|
|
|
|
| 3 |
import uuid
|
| 4 |
from contextlib import asynccontextmanager
|
| 5 |
from typing import Any, Generator
|
src/gazet/sql.py
CHANGED
|
@@ -5,6 +5,12 @@ from typing import Any, Generator, Optional
|
|
| 5 |
import duckdb
|
| 6 |
import pandas as pd
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
_CANDIDATE_PROMPT_COLS = [
|
| 9 |
"source",
|
| 10 |
"id",
|
|
@@ -15,12 +21,6 @@ _CANDIDATE_PROMPT_COLS = [
|
|
| 15 |
"admin_level",
|
| 16 |
]
|
| 17 |
|
| 18 |
-
from .config import DIVISIONS_AREA_PATH, MAX_SQL_ITERATIONS, NATURAL_EARTH_PATH, SCHEMA_INFO
|
| 19 |
-
from .geometry import normalize_geometry_to_geojson
|
| 20 |
-
from .lm import generate_sql, write_sql
|
| 21 |
-
|
| 22 |
-
logger = logging.getLogger(__name__)
|
| 23 |
-
|
| 24 |
|
| 25 |
def _rewrite_data_paths(sql: str) -> str:
|
| 26 |
"""Replace any read_parquet table reference with the correct runtime path.
|
|
|
|
| 5 |
import duckdb
|
| 6 |
import pandas as pd
|
| 7 |
|
| 8 |
+
from .config import DIVISIONS_AREA_PATH, MAX_SQL_ITERATIONS, NATURAL_EARTH_PATH, SCHEMA_INFO
|
| 9 |
+
from .geometry import normalize_geometry_to_geojson
|
| 10 |
+
from .lm import generate_sql, write_sql
|
| 11 |
+
|
| 12 |
+
logger = logging.getLogger(__name__)
|
| 13 |
+
|
| 14 |
_CANDIDATE_PROMPT_COLS = [
|
| 15 |
"source",
|
| 16 |
"id",
|
|
|
|
| 21 |
"admin_level",
|
| 22 |
]
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
def _rewrite_data_paths(sql: str) -> str:
|
| 26 |
"""Replace any read_parquet table reference with the correct runtime path.
|