Skip to content

Commit 4127576

Browse files
authored
fix: _cleaned_columns function now works with python multiline and typings (#556)
1 parent e75247e commit 4127576

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

postgrest/base_request_builder.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,21 @@ def _unique_columns(json: List[Dict]):
5252
return columns
5353

5454

55-
def _cleaned_columns(columns: str) -> str:
55+
def _cleaned_columns(columns: Tuple[str, ...]) -> str:
5656
quoted = False
57-
result = []
58-
59-
for c in columns:
60-
if c.isspace() and not quoted:
61-
continue
62-
if c == '"':
63-
quoted = not quoted
64-
result.append(c)
65-
66-
return ",".join(result)
57+
cleaned = []
58+
59+
for column in columns:
60+
clean_column = ""
61+
for char in column:
62+
if char.isspace() and not quoted:
63+
continue
64+
if char == '"':
65+
quoted = not quoted
66+
clean_column += char
67+
cleaned.append(clean_column)
68+
69+
return ",".join(cleaned)
6770

6871

6972
def pre_select(

0 commit comments

Comments
 (0)