We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ed3035 commit f778c10Copy full SHA for f778c10
1 file changed
digital_land/expectations/operations/csv.py
@@ -13,13 +13,10 @@ def _read_csv(file_path: Path) -> str:
13
14
15
def _get_csv_columns(conn, file_path: Path) -> list:
16
- """Get column names from CSV file."""
17
- return [
18
- col[0]
19
- for col in conn.execute(
20
- f"SELECT * FROM {_read_csv(file_path)} LIMIT 0"
21
- ).description
22
- ]
+ result = conn.execute(
+ "DESCRIBE SELECT * FROM read_csv_auto(?)", [str(file_path)]
+ ).fetchall()
+ return [row[0] for row in result]
23
24
25
def _sql_string(value) -> str:
0 commit comments