Repository: betodealmeida/shillelagh

Issue:
Comparison with empty string throws Invalid query: NO_COLUMN: null
**Describe the bug**
Comparison with empty string throws Invalid query: NO_COLUMN: null (at least for Google Sheets sources)

**To Reproduce**
Take the query from the README:

```
SELECT country, SUM(cnt)
FROM "https://docs.google.com/spreadsheets/d/1_rN3lm0R_bU3NemO0s9pbFkY5LQPcuy1pscv8ZXPtg8/edit#gid=0"
WHERE cnt > 0
GROUP BY country
```

Add a comparison with empty string:

```
SELECT country, SUM(cnt)
FROM "https://docs.google.com/spreadsheets/d/1_rN3lm0R_bU3NemO0s9pbFkY5LQPcuy1pscv8ZXPtg8/edit#gid=0"
WHERE cnt > 0 AND country != ''
GROUP BY country
```

Raises:

```
ProgrammingError: (shillelagh.exceptions.ProgrammingError) Invalid query: NO_COLUMN: null
```

Discussion:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 7ea20a8..1dab8f1 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -6,6 +6,7 @@ Next
 ====
 
 - Fix unneeded error when an operators is not supported by adapter (#378)
+- Fix comparison to empty strings in GSheets (#379)
 
 Version 1.2.6 - 2023-07-20
 ==========================
diff --git a/src/shillelagh/adapters/api/gsheets/fields.py b/src/shillelagh/adapters/api/gsheets/fields.py
index 7db343d..1f24b96 100644
--- a/src/shillelagh/adapters/api/gsheets/fields.py
+++ b/src/shillelagh/adapters/api/gsheets/fields.py
@@ -328,7 +328,7 @@ class GSheetsString(GSheetsField[str, str]):
         return "" if value is None else value
 
     def quote(self, value: Optional[str]) -> str:
-        if value == "" or value is None:
+        if value is None:
             return "null"
 
         return f"'{value}'"


Test patch:
diff --git a/tests/adapters/api/gsheets/fields_test.py b/tests/adapters/api/gsheets/fields_test.py
index d6a041f..0c9efd3 100644
--- a/tests/adapters/api/gsheets/fields_test.py
+++ b/tests/adapters/api/gsheets/fields_test.py
@@ -217,5 +217,5 @@ def test_GSheetsString() -> None:
     assert GSheetsString().format("test") == "test"
 
     assert GSheetsString().quote(None) == "null"
-    assert GSheetsString().quote("") == "null"
+    assert GSheetsString().quote("") == "''"
     assert GSheetsString().quote("test") == "'test'"