From a53f1f4b82534c6e80aa597e69a6a71fbae20e62 Mon Sep 17 00:00:00 2001 From: jiisanda Date: Wed, 11 Jun 2025 21:12:25 +0000 Subject: [PATCH 1/8] feat: text_to_column - main login --- gspread/utils.py | 10 +++++++++ gspread/worksheet.py | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/gspread/utils.py b/gspread/utils.py index 6daac8616..4edd33822 100644 --- a/gspread/utils.py +++ b/gspread/utils.py @@ -174,6 +174,16 @@ class TableDirection(StrEnum): right = "RIGHT" +class DelimiterType(StrEnum): + unspecified = "DELIMITER_TYPE_UNSPECIFIED" + comma = "COMMA" + semicolon = "SEMICOLON" + peroid = "PEROID" + space = "SPACE" + custom = "CUSTOM" + autodetect = "AUTODETECT" + + def convert_credentials(credentials: Credentials) -> Credentials: module = credentials.__module__ cls = credentials.__class__.__name__ diff --git a/gspread/worksheet.py b/gspread/worksheet.py index ba9fde0a4..12ef6d4f7 100644 --- a/gspread/worksheet.py +++ b/gspread/worksheet.py @@ -62,6 +62,7 @@ numericise_all, rowcol_to_a1, to_records, + DelimiterType, ) if TYPE_CHECKING is True: @@ -3451,3 +3452,53 @@ def expand( values = self.get(pad_values=True) return find_table(values, top_left_range_name, direction) + + def _text_to_column( + self, + src_range: str, + delimiter_type: DelimiterType = DelimiterType.comma, + custom_delimiter: Optional[str] = None, + ) -> JSONResponse: + grid_range = a1_range_to_grid_range(src_range, self.id) + + start = grid_range.get("startColumnIndex") + end = grid_range.get("endColumnIndex") + + if start is not None and end is not None: + if end - start != 1: + raise ValueError( + f"Source range must span exactly one column. " + f"Got range spanning {end - start} columns." + ) + + if delimiter_type == DelimiterType.custom and custom_delimiter is None: + raise ValueError( + "custom_delimiter parameter is required when delimiter_type is DelimiterType.custom" + ) + + text_to_columns_request: Dict[str, Any] = { + "source": grid_range, + "delimiterType": delimiter_type, + } + + if delimiter_type == DelimiterType.custom and custom_delimiter is not None: + text_to_columns_request["delimiter"] = custom_delimiter + + body = { + "requests": [ + { + "textToColumns": text_to_columns_request + } + ] + } + + return self.client.batch_update(self.spreadsheet_id, body) + + @cast_to_a1_notation + def text_to_column( + self, + source_range: str, + delimiter_type: DelimiterType = DelimiterType.comma, + custom_delimiter: Optional[str] = None, + ) -> JSONResponse: + return self._text_to_column(source_range, delimiter_type, custom_delimiter) From 53b6d229320af81990ce4817c7a19156f12df2cc Mon Sep 17 00:00:00 2001 From: jiisanda Date: Wed, 11 Jun 2025 21:29:09 +0000 Subject: [PATCH 2/8] add: docstring --- gspread/worksheet.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gspread/worksheet.py b/gspread/worksheet.py index 12ef6d4f7..54d9c4b12 100644 --- a/gspread/worksheet.py +++ b/gspread/worksheet.py @@ -3501,4 +3501,42 @@ def text_to_column( delimiter_type: DelimiterType = DelimiterType.comma, custom_delimiter: Optional[str] = None, ) -> JSONResponse: + """ + Split text from a single column into multiple columns based on a delimiter. + + :param str source_range: A string with range value in A1 notation (e.g., 'A:A', 'B2:B10'). + The range must span exactly one column. + + :param delimiter_type: The type of delimiter to use for splitting. + Possible values are: + + ``DelimiterType.comma`` - Split on commas "," + ``DelimiterType.semicolon`` - Split on semicolons ";" + ``DelimiterType.period`` - Split on periods "." + ``DelimiterType.space`` - Split on spaces " " + ``DelimiterType.custom`` - Split on a custom delimiter (requires `custom_delimiter`) + ``DelimiterType.autodetect`` - Automatically detect the delimiter + + :type delimiter_type: :class:`~gspread.utils.DelimiterType` + + :param str custom_delimiter: (optional) The custom delimiter to use. + Required when `delimiter_type` is `DelimiterType.custom`. + + :returns: The response body from the request + :rtype: JSONResponse + + :raises ValueError: If the source range spans more than one column, or if + `delimiter_type` is CUSTOM but no `custom_delimiter` is provided. + + Example:: + + # Split column A on commas + worksheet.text_to_column('A:A', DelimiterType.comma) + + # Split range B2:B10 using a custom delimiter + worksheet.text_to_column('B2:B10', DelimiterType.custom, custom_delimiter='|') + + # Auto-detect delimiter for column C + worksheet.text_to_column('C:C', DelimiterType.autodetect) + """ return self._text_to_column(source_range, delimiter_type, custom_delimiter) From 21d88297c0b02257b4f5c84a97a909edad40ed50 Mon Sep 17 00:00:00 2001 From: jiisanda Date: Wed, 11 Jun 2025 21:31:45 +0000 Subject: [PATCH 3/8] fix: linting --- gspread/worksheet.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/gspread/worksheet.py b/gspread/worksheet.py index 54d9c4b12..88870853f 100644 --- a/gspread/worksheet.py +++ b/gspread/worksheet.py @@ -3484,13 +3484,7 @@ def _text_to_column( if delimiter_type == DelimiterType.custom and custom_delimiter is not None: text_to_columns_request["delimiter"] = custom_delimiter - body = { - "requests": [ - { - "textToColumns": text_to_columns_request - } - ] - } + body = {"requests": [{"textToColumns": text_to_columns_request}]} return self.client.batch_update(self.spreadsheet_id, body) @@ -3503,39 +3497,39 @@ def text_to_column( ) -> JSONResponse: """ Split text from a single column into multiple columns based on a delimiter. - + :param str source_range: A string with range value in A1 notation (e.g., 'A:A', 'B2:B10'). The range must span exactly one column. - + :param delimiter_type: The type of delimiter to use for splitting. Possible values are: - + ``DelimiterType.comma`` - Split on commas "," ``DelimiterType.semicolon`` - Split on semicolons ";" ``DelimiterType.period`` - Split on periods "." ``DelimiterType.space`` - Split on spaces " " ``DelimiterType.custom`` - Split on a custom delimiter (requires `custom_delimiter`) ``DelimiterType.autodetect`` - Automatically detect the delimiter - + :type delimiter_type: :class:`~gspread.utils.DelimiterType` - + :param str custom_delimiter: (optional) The custom delimiter to use. Required when `delimiter_type` is `DelimiterType.custom`. - + :returns: The response body from the request :rtype: JSONResponse - - :raises ValueError: If the source range spans more than one column, or if + + :raises ValueError: If the source range spans more than one column, or if `delimiter_type` is CUSTOM but no `custom_delimiter` is provided. - + Example:: - + # Split column A on commas worksheet.text_to_column('A:A', DelimiterType.comma) - + # Split range B2:B10 using a custom delimiter worksheet.text_to_column('B2:B10', DelimiterType.custom, custom_delimiter='|') - + # Auto-detect delimiter for column C worksheet.text_to_column('C:C', DelimiterType.autodetect) """ From a5feb0f9346ba72b06dac9438b0d18c3e234b2d1 Mon Sep 17 00:00:00 2001 From: jiisanda Date: Wed, 11 Jun 2025 21:36:34 +0000 Subject: [PATCH 4/8] fix: typeo --- gspread/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gspread/utils.py b/gspread/utils.py index 4edd33822..86d057f58 100644 --- a/gspread/utils.py +++ b/gspread/utils.py @@ -178,7 +178,7 @@ class DelimiterType(StrEnum): unspecified = "DELIMITER_TYPE_UNSPECIFIED" comma = "COMMA" semicolon = "SEMICOLON" - peroid = "PEROID" + peroid = "PERIOD" space = "SPACE" custom = "CUSTOM" autodetect = "AUTODETECT" From c2ebe3a4ae3b14d10d2e1ba572b5d06847b8cbda Mon Sep 17 00:00:00 2001 From: jiisanda Date: Sun, 22 Jun 2025 15:15:51 +0000 Subject: [PATCH 5/8] test-to-column tests --- gspread/utils.py | 2 +- tests/worksheet_test.py | 204 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 1 deletion(-) diff --git a/gspread/utils.py b/gspread/utils.py index 86d057f58..856d3b81a 100644 --- a/gspread/utils.py +++ b/gspread/utils.py @@ -178,7 +178,7 @@ class DelimiterType(StrEnum): unspecified = "DELIMITER_TYPE_UNSPECIFIED" comma = "COMMA" semicolon = "SEMICOLON" - peroid = "PERIOD" + period = "PERIOD" space = "SPACE" custom = "CUSTOM" autodetect = "AUTODETECT" diff --git a/tests/worksheet_test.py b/tests/worksheet_test.py index f8523b5bd..85aa2ba4c 100644 --- a/tests/worksheet_test.py +++ b/tests/worksheet_test.py @@ -2007,3 +2007,207 @@ def test_add_validation(self): # Further ensure we are able to access the exception's properties after pickling reloaded_exception = pickle.loads(pickle.dumps(ex.exception)) # nosec self.assertEqual(reloaded_exception.args[0]["status"], "INVALID_ARGUMENT") + + @pytest.mark.vcr() + def test_text_to_column_comma_delimiter(self): + test_data = [ + ["apple,banana,cherry"], + ["red,blue,green"], + ["one,two,three,four"] + ] + + self.sheet.update(test_data, "A1:A3") + + response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.comma) + + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + self.assertEqual(response["spreadsheetId"], self.spreadsheet.id) + + result_data = self.sheet.get("A1:D3") + + expected_data = [ + ["apple", "banana", "cherry"], + ["red", "blue", "green"], + ["one", "two", "three", "four"] + ] + + self.assertEqual(result_data, expected_data) + + + @pytest.mark.vcr() + def test_text_to_column_custom_delimiter_pipe(self): + test_data = [ + ["apple|banana|cherry"], + ["red|blue|green"], + ["one|two|three|four"] + ] + + self.sheet.update(test_data, "A1:A3") + + response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.custom, custom_delimiter="|") + + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + self.assertEqual(response["spreadsheetId"], self.spreadsheet.id) + + result_data = self.sheet.get("A1:D3", pad_values=True) + + expected_data = [ + ["apple", "banana", "cherry", ""], + ["red", "blue", "green", ""], + ["one", "two", "three", "four"] + ] + + self.assertEqual(result_data, expected_data) + + @pytest.mark.vcr() + def test_text_to_column_autodetect_delimiter(self): + # Test autodetect with consistent comma delimiters + test_data = [ + ["apple,banana,cherry"], + ["red,blue,green"], + ["one,two,three"] + ] + + self.sheet.update(test_data, "A1:A3") + + response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.autodetect) + + # Check response structure + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + self.assertEqual(response["spreadsheetId"], self.spreadsheet.id) + + # The autodetect should detect comma as the delimiter and split all rows + result_data = self.sheet.get("A1:C3", pad_values=True) + + expected_data = [ + ["apple", "banana", "cherry"], + ["red", "blue", "green"], + ["one", "two", "three"] + ] + + self.assertEqual(result_data, expected_data) + + @pytest.mark.vcr() + def test_text_to_column_with_cast_to_a1_notation(self): + test_data = [ + ["apple,banana"], + ["red,blue"] + ] + + self.sheet.update(test_data, "A1:A2") + + # Test using numeric coordinates (should be converted to A1 notation) + response = self.sheet.text_to_column(1, 1, 2, 1, utils.DelimiterType.comma) + + # Check response structure + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + self.assertEqual(response["spreadsheetId"], self.spreadsheet.id) + + # Verify the split worked + result_data = self.sheet.get("A1:B2", pad_values=True) + expected_data = [ + ["apple", "banana"], + ["red", "blue"] + ] + + self.assertEqual(result_data, expected_data) + + def test_text_to_column_invalid_range_multiple_columns(self): + # Test without @pytest.mark.vcr() since this should raise an error before API call + with self.assertRaises(ValueError) as context: + self.sheet.text_to_column("A1:B1", utils.DelimiterType.comma) + + self.assertIn("Source range must span exactly one column", str(context.exception)) + self.assertIn("Got range spanning 2 columns", str(context.exception)) + + def test_text_to_column_custom_delimiter_missing(self): + # Test without @pytest.mark.vcr() since this should raise an error before API call + with self.assertRaises(ValueError) as context: + self.sheet.text_to_column("A1:A1", utils.DelimiterType.custom) + + self.assertIn("custom_delimiter parameter is required", str(context.exception)) + + @pytest.mark.vcr() + def test_text_to_column_empty_cells(self): + test_data = [ + ["apple,banana"], + [""], # Empty cell + ["red,blue"] + ] + + self.sheet.update(test_data, "A1:A3") + + response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.comma) + + # Check response structure + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + + # Get result data + result_data = self.sheet.get("A1:B3", pad_values=True) + + expected_data = [ + ["apple", "banana"], + ["", ""], # Empty cell should remain empty + ["red", "blue"] + ] + + self.assertEqual(result_data, expected_data) + + @pytest.mark.vcr() + def test_text_to_column_no_delimiter_found(self): + test_data = [ + ["apple"], # No delimiter + ["banana"], # No delimiter + ["cherry"] # No delimiter + ] + + self.sheet.update(test_data, "A1:A3") + + response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.comma) + + # Check response structure + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + + # When no delimiter is found, text should remain in original column + result_data = self.sheet.get("A1:A3") + + expected_data = [ + ["apple"], + ["banana"], + ["cherry"] + ] + + self.assertEqual(result_data, expected_data) + + @pytest.mark.vcr() + def test_text_to_column_with_unicode_text(self): + test_data = [ + ["café,naïve,résumé"], + ["北京,東京,서울"], + ["🍎,🍌,🍒"] + ] + + self.sheet.update(test_data, "A1:A3") + + response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.comma) + + # Check response structure + self.assertIn("spreadsheetId", response) + self.assertIn("replies", response) + + # Get result data + result_data = self.sheet.get("A1:C3", pad_values=True) + + expected_data = [ + ["café", "naïve", "résumé"], + ["北京", "東京", "서울"], + ["🍎", "🍌", "🍒"] + ] + + self.assertEqual(result_data, expected_data) From 60b736dfc489a2ac4d4618558b3bad4607ff1c71 Mon Sep 17 00:00:00 2001 From: jiisanda Date: Sun, 22 Jun 2025 15:19:29 +0000 Subject: [PATCH 6/8] VCR cassette files --- ...t_text_to_column_autodetect_delimiter.json | 594 ++++++++++++++++++ ...t.test_text_to_column_comma_delimiter.json | 594 ++++++++++++++++++ ..._text_to_column_custom_delimiter_pipe.json | 594 ++++++++++++++++++ ...tTest.test_text_to_column_empty_cells.json | 594 ++++++++++++++++++ ...text_to_column_mixed_delimiter_counts.json | 594 ++++++++++++++++++ ...n_multiple_character_custom_delimiter.json | 594 ++++++++++++++++++ ...est_text_to_column_no_delimiter_found.json | 594 ++++++++++++++++++ ....test_text_to_column_period_delimiter.json | 448 +++++++++++++ ...eserve_existing_data_in_other_columns.json | 594 ++++++++++++++++++ ...st_text_to_column_semicolon_delimiter.json | 594 ++++++++++++++++++ ...t.test_text_to_column_space_delimiter.json | 594 ++++++++++++++++++ ...xt_to_column_with_cast_to_a1_notation.json | 594 ++++++++++++++++++ ...test_text_to_column_with_unicode_text.json | 594 ++++++++++++++++++ 13 files changed, 7576 insertions(+) create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_autodetect_delimiter.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_comma_delimiter.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_custom_delimiter_pipe.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_empty_cells.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_mixed_delimiter_counts.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_multiple_character_custom_delimiter.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_no_delimiter_found.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_period_delimiter.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_preserve_existing_data_in_other_columns.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_semicolon_delimiter.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_space_delimiter.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_with_cast_to_a1_notation.json create mode 100644 tests/cassettes/WorksheetTest.test_text_to_column_with_unicode_text.json diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_autodetect_delimiter.json b/tests/cassettes/WorksheetTest.test_text_to_column_autodetect_delimiter.json new file mode 100644 index 000000000..3bff2badc --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_autodetect_delimiter.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_autodetect_delimiter\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "126" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:52 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "213" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis\",\n \"name\": \"Test WorksheetTest test_text_to_column_autodetect_delimiter\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:53 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "3357" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_autodetect_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:53 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "3357" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_autodetect_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:53 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"apple,banana,cherry\"], [\"red,blue,green\"], [\"one,two,three\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "100" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:54 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"AUTODETECT\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "174" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:54 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis/values/%27Sheet1%27%21A1%3AC3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:55 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "content-length": [ + "242" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:C3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"cherry\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ],\n [\n \"one\",\n \"two\",\n \"three\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1A1_zlQuZeup8YzM1BeqpfZt133gCsoE0qmfFJULnSis?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "X-Content-Type-Options": [ + "nosniff" + ], + "X-XSS-Protection": [ + "0" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Date": [ + "Sun, 22 Jun 2025 15:11:55 GMT" + ], + "Content-Length": [ + "0" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Content-Type": [ + "text/html" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_comma_delimiter.json b/tests/cassettes/WorksheetTest.test_text_to_column_comma_delimiter.json new file mode 100644 index 000000000..e0220361d --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_comma_delimiter.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_comma_delimiter\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "121" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Server": [ + "ESF" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:39 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin, X-Origin" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "208" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M\",\n \"name\": \"Test WorksheetTest test_text_to_column_comma_delimiter\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:40 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "3352" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_comma_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:40 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "3352" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_comma_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:40 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"apple,banana,cherry\"], [\"red,blue,green\"], [\"one,two,three,four\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "105" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:41 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:41 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M/values/%27Sheet1%27%21A1%3AD3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "Server": [ + "ESF" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:42 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "256" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:D3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"cherry\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ],\n [\n \"one\",\n \"two\",\n \"three\",\n \"four\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/15jqauf9l-eciDTwO1y7pgMhvRGzaCeuwzhie5mh3V_M?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Content-Type": [ + "text/html" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Pragma": [ + "no-cache" + ], + "Content-Length": [ + "0" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Server": [ + "ESF" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Date": [ + "Sun, 22 Jun 2025 14:56:43 GMT" + ], + "Vary": [ + "Origin, X-Origin" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_custom_delimiter_pipe.json b/tests/cassettes/WorksheetTest.test_text_to_column_custom_delimiter_pipe.json new file mode 100644 index 000000000..4a8b16c68 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_custom_delimiter_pipe.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_custom_delimiter_pipe\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "127" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Origin, X-Origin" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "214" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ\",\n \"name\": \"Test WorksheetTest test_text_to_column_custom_delimiter_pipe\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:46 GMT" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "3358" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_custom_delimiter_pipe\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:47 GMT" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "3358" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_custom_delimiter_pipe\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:47 GMT" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"apple|banana|cherry\"], [\"red|blue|green\"], [\"one|two|three|four\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "105" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:47 GMT" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"CUSTOM\", \"delimiter\": \"|\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "188" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:48 GMT" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ/values/%27Sheet1%27%21A1%3AD3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "x-l2-request-path": [ + "l2-managed-6" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Transfer-Encoding": [ + "chunked" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:48 GMT" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "content-length": [ + "256" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:D3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"cherry\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ],\n [\n \"one\",\n \"two\",\n \"three\",\n \"four\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/18mSkwZcIx1skrJ0GkPRuwKgBhzLZl5FyLaA203JErNQ?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Content-Length": [ + "0" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Date": [ + "Sun, 22 Jun 2025 14:59:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Origin, X-Origin" + ], + "X-Content-Type-Options": [ + "nosniff" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_empty_cells.json b/tests/cassettes/WorksheetTest.test_text_to_column_empty_cells.json new file mode 100644 index 000000000..c4a680314 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_empty_cells.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_empty_cells\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "117" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "204" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8\",\n \"name\": \"Test WorksheetTest test_text_to_column_empty_cells\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:16 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3348" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_empty_cells\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:16 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3348" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_empty_cells\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:17 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"apple,banana\"], [\"\"], [\"red,blue\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "74" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:17 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:18 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8/values/%27Sheet1%27%21A1%3AB3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:18 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "166" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:B3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\"\n ],\n [],\n [\n \"red\",\n \"blue\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1lwfeLQVVRld8rBdm0TT8WnZcacSvXvHZIxYUlSiSop8?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_mixed_delimiter_counts.json b/tests/cassettes/WorksheetTest.test_text_to_column_mixed_delimiter_counts.json new file mode 100644 index 000000000..5bc3fe0c1 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_mixed_delimiter_counts.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_mixed_delimiter_counts\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "128" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "215" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk\",\n \"name\": \"Test WorksheetTest test_text_to_column_mixed_delimiter_counts\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:26 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3359" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_mixed_delimiter_counts\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:27 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3359" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_mixed_delimiter_counts\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:27 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"apple,banana\"], [\"red,blue,green\"], [\"one,two,three,four,five\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "103" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:27 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:29 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk/values/%27Sheet1%27%21A1%3AE3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:29 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "254" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:E3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ],\n [\n \"one\",\n \"two\",\n \"three\",\n \"four\",\n \"five\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1oDJeuB4qAy_snDHXr_YTpWBA00vhQWiRX_GcEhYs4mk?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_multiple_character_custom_delimiter.json b/tests/cassettes/WorksheetTest.test_text_to_column_multiple_character_custom_delimiter.json new file mode 100644 index 000000000..596e7cf75 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_multiple_character_custom_delimiter.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_multiple_character_custom_delimiter\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "141" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:33 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "228" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc\",\n \"name\": \"Test WorksheetTest test_text_to_column_multiple_character_custom_delimiter\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:33 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3372" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_multiple_character_custom_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:34 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3372" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_multiple_character_custom_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:34 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc/values/%27Sheet1%27%21A1%3AA2?valueInputOption=RAW", + "body": "{\"values\": [[\"apple::banana::cherry\"], [\"red::blue::green\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "85" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:34 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc\",\n \"updatedRange\": \"Sheet1!A1:A2\",\n \"updatedRows\": 2,\n \"updatedColumns\": 1,\n \"updatedCells\": 2\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 2, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"CUSTOM\", \"delimiter\": \"::\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "189" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:35 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc/values/%27Sheet1%27%21A1%3AC2", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:35 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "189" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:C2\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"cherry\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1e5lPKtcTedBZCwN3gYfPOTaXknfn25qqFBXl-AIrJsc?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:36 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_no_delimiter_found.json b/tests/cassettes/WorksheetTest.test_text_to_column_no_delimiter_found.json new file mode 100644 index 000000000..67d5b56b5 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_no_delimiter_found.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_no_delimiter_found\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "124" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:38 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "211" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U\",\n \"name\": \"Test WorksheetTest test_text_to_column_no_delimiter_found\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:39 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3355" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_no_delimiter_found\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:39 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3355" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_no_delimiter_found\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:40 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"apple\"], [\"banana\"], [\"cherry\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "71" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:40 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:40 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U/values/%27Sheet1%27%21A1%3AA3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:41 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "159" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:A3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\"\n ],\n [\n \"banana\"\n ],\n [\n \"cherry\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1-N4Hj6HCb8aLWkAviTZ-krXLBQEwvEaPIoaJcfAUP2U?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_period_delimiter.json b/tests/cassettes/WorksheetTest.test_text_to_column_period_delimiter.json new file mode 100644 index 000000000..5fd7a70be --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_period_delimiter.json @@ -0,0 +1,448 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_period_delimiter\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "122" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:45 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "209" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk\",\n \"name\": \"Test WorksheetTest test_text_to_column_period_delimiter\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:46 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3353" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_period_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:46 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3353" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_period_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:47 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk/values/%27Sheet1%27%21A1%3AA2?valueInputOption=RAW", + "body": "{\"values\": [[\"apple.banana.cherry\"], [\"red.blue.green\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "81" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:47 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk\",\n \"updatedRange\": \"Sheet1!A1:A2\",\n \"updatedRows\": 2,\n \"updatedColumns\": 1,\n \"updatedCells\": 2\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1BG_G3LomL8-_Wlk6Kt4wykyikHbVZayc11Nhn3By6Hk?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:48 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_preserve_existing_data_in_other_columns.json b/tests/cassettes/WorksheetTest.test_text_to_column_preserve_existing_data_in_other_columns.json new file mode 100644 index 000000000..849788603 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_preserve_existing_data_in_other_columns.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_preserve_existing_data_in_other_columns\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "145" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:50 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "232" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY\",\n \"name\": \"Test WorksheetTest test_text_to_column_preserve_existing_data_in_other_columns\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:52 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3376" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_preserve_existing_data_in_other_columns\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:53 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3376" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_preserve_existing_data_in_other_columns\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:54 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY/values/%27Sheet1%27%21A1%3AC2?valueInputOption=RAW", + "body": "{\"values\": [[\"apple,banana\", \"keep1\", \"keep2\"], [\"red,blue\", \"keep3\", \"keep4\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "104" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:55 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY\",\n \"updatedRange\": \"Sheet1!A1:C2\",\n \"updatedRows\": 2,\n \"updatedColumns\": 3,\n \"updatedCells\": 6\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 2, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:56 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY/values/%27Sheet1%27%21A1%3AD2", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:01:57 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "188" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:D2\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"keep2\"\n ],\n [\n \"red\",\n \"blue\",\n \"keep4\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1ZWrzgNLK5JvonC2FnqghN7ysYLVuNX_MOzyIEtLRSpY?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:01:58 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_semicolon_delimiter.json b/tests/cassettes/WorksheetTest.test_text_to_column_semicolon_delimiter.json new file mode 100644 index 000000000..15b2f75a0 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_semicolon_delimiter.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_semicolon_delimiter\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "125" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:00 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "212" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y\",\n \"name\": \"Test WorksheetTest test_text_to_column_semicolon_delimiter\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:01 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3356" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_semicolon_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:01 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3356" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_semicolon_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:02 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y/values/%27Sheet1%27%21A1%3AA2?valueInputOption=RAW", + "body": "{\"values\": [[\"apple;banana;cherry\"], [\"red;blue;green\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "81" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:02 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y\",\n \"updatedRange\": \"Sheet1!A1:A2\",\n \"updatedRows\": 2,\n \"updatedColumns\": 1,\n \"updatedCells\": 2\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 2, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"SEMICOLON\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "173" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:03 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y/values/%27Sheet1%27%21A1%3AC2", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:03 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "189" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:C2\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"cherry\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1OtfKdU-lfdUX-7irr_eEUiMVNde_RbgzGySe3UgW20Y?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_space_delimiter.json b/tests/cassettes/WorksheetTest.test_text_to_column_space_delimiter.json new file mode 100644 index 000000000..40293f0bd --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_space_delimiter.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_space_delimiter\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "121" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:07 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "208" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo\",\n \"name\": \"Test WorksheetTest test_text_to_column_space_delimiter\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:09 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3352" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_space_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:09 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3352" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_space_delimiter\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:10 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo/values/%27Sheet1%27%21A1%3AA2?valueInputOption=RAW", + "body": "{\"values\": [[\"apple banana cherry\"], [\"red blue green\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "81" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:11 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo\",\n \"updatedRange\": \"Sheet1!A1:A2\",\n \"updatedRows\": 2,\n \"updatedColumns\": 1,\n \"updatedCells\": 2\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 2, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"SPACE\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:12 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo/values/%27Sheet1%27%21A1%3AC2", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:12 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "189" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:C2\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\",\n \"cherry\"\n ],\n [\n \"red\",\n \"blue\",\n \"green\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/12yn-QKsyA1Wp-RohcC4uVFSnvp-nbS8jknDDrvupLVo?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:13 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_with_cast_to_a1_notation.json b/tests/cassettes/WorksheetTest.test_text_to_column_with_cast_to_a1_notation.json new file mode 100644 index 000000000..e5c773c38 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_with_cast_to_a1_notation.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_with_cast_to_a1_notation\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "130" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "217" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo\",\n \"name\": \"Test WorksheetTest test_text_to_column_with_cast_to_a1_notation\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:20 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3361" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_with_cast_to_a1_notation\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:21 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3361" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_with_cast_to_a1_notation\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:21 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo/values/%27Sheet1%27%21A1%3AA2?valueInputOption=RAW", + "body": "{\"values\": [[\"apple,banana\"], [\"red,blue\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "68" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:22 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo\",\n \"updatedRange\": \"Sheet1!A1:A2\",\n \"updatedRows\": 2,\n \"updatedColumns\": 1,\n \"updatedCells\": 2\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 2, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:22 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo/values/%27Sheet1%27%21A1%3AB2", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:22 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "158" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:B2\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"apple\",\n \"banana\"\n ],\n [\n \"red\",\n \"blue\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1ooJQha9uRhuoVBzeO_kgU-fNwY2YjbxjihOKpjMI_qo?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:24 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} diff --git a/tests/cassettes/WorksheetTest.test_text_to_column_with_unicode_text.json b/tests/cassettes/WorksheetTest.test_text_to_column_with_unicode_text.json new file mode 100644 index 000000000..98bbd1ff2 --- /dev/null +++ b/tests/cassettes/WorksheetTest.test_text_to_column_with_unicode_text.json @@ -0,0 +1,594 @@ +{ + "version": 1, + "interactions": [ + { + "request": { + "method": "POST", + "uri": "https://www.googleapis.com/drive/v3/files?supportsAllDrives=True", + "body": "{\"name\": \"Test WorksheetTest test_text_to_column_with_unicode_text\", \"mimeType\": \"application/vnd.google-apps.spreadsheet\"}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "123" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:26 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "X-XSS-Protection": [ + "0" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "content-length": [ + "210" + ] + }, + "body": { + "string": "{\n \"kind\": \"drive#file\",\n \"id\": \"1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI\",\n \"name\": \"Test WorksheetTest test_text_to_column_with_unicode_text\",\n \"mimeType\": \"application/vnd.google-apps.spreadsheet\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:28 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3354" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_with_unicode_text\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI?includeGridData=false", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:28 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "3354" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI\",\n \"properties\": {\n \"title\": \"Test WorksheetTest test_text_to_column_with_unicode_text\",\n \"locale\": \"en_US\",\n \"autoRecalc\": \"ON_CHANGE\",\n \"timeZone\": \"Etc/GMT\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n },\n \"padding\": {\n \"top\": 2,\n \"right\": 3,\n \"bottom\": 2,\n \"left\": 3\n },\n \"verticalAlignment\": \"BOTTOM\",\n \"wrapStrategy\": \"OVERFLOW_CELL\",\n \"textFormat\": {\n \"foregroundColor\": {},\n \"fontFamily\": \"arial,sans,sans-serif\",\n \"fontSize\": 10,\n \"bold\": false,\n \"italic\": false,\n \"strikethrough\": false,\n \"underline\": false,\n \"foregroundColorStyle\": {\n \"rgbColor\": {}\n }\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"Arial\",\n \"themeColors\": [\n {\n \"colorType\": \"TEXT\",\n \"color\": {\n \"rgbColor\": {}\n }\n },\n {\n \"colorType\": \"BACKGROUND\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 1,\n \"blue\": 1\n }\n }\n },\n {\n \"colorType\": \"ACCENT1\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.25882354,\n \"green\": 0.52156866,\n \"blue\": 0.95686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT2\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.91764706,\n \"green\": 0.2627451,\n \"blue\": 0.20784314\n }\n }\n },\n {\n \"colorType\": \"ACCENT3\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.9843137,\n \"green\": 0.7372549,\n \"blue\": 0.015686275\n }\n }\n },\n {\n \"colorType\": \"ACCENT4\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.20392157,\n \"green\": 0.65882355,\n \"blue\": 0.3254902\n }\n }\n },\n {\n \"colorType\": \"ACCENT5\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 1,\n \"green\": 0.42745098,\n \"blue\": 0.003921569\n }\n }\n },\n {\n \"colorType\": \"ACCENT6\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.27450982,\n \"green\": 0.7411765,\n \"blue\": 0.7764706\n }\n }\n },\n {\n \"colorType\": \"LINK\",\n \"color\": {\n \"rgbColor\": {\n \"red\": 0.06666667,\n \"green\": 0.33333334,\n \"blue\": 0.8\n }\n }\n }\n ]\n }\n },\n \"sheets\": [\n {\n \"properties\": {\n \"sheetId\": 0,\n \"title\": \"Sheet1\",\n \"index\": 0,\n \"sheetType\": \"GRID\",\n \"gridProperties\": {\n \"rowCount\": 1000,\n \"columnCount\": 26\n }\n }\n }\n ],\n \"spreadsheetUrl\": \"https://docs.google.com/spreadsheets/d/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI/edit\"\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI/values/%27Sheet1%27:clear", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:29 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "107" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI\",\n \"clearedRange\": \"Sheet1!A1:Z1000\"\n}\n" + } + } + }, + { + "request": { + "method": "PUT", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI/values/%27Sheet1%27%21A1%3AA3?valueInputOption=RAW", + "body": "{\"values\": [[\"caf\\u00e9,na\\u00efve,r\\u00e9sum\\u00e9\"], [\"\\u5317\\u4eac,\\u6771\\u4eac,\\uc11c\\uc6b8\"], [\"\\ud83c\\udf4e,\\ud83c\\udf4c,\\ud83c\\udf52\"]], \"majorDimension\": null}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "167" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:30 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "168" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI\",\n \"updatedRange\": \"Sheet1!A1:A3\",\n \"updatedRows\": 3,\n \"updatedColumns\": 1,\n \"updatedCells\": 3\n}\n" + } + } + }, + { + "request": { + "method": "POST", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI:batchUpdate", + "body": "{\"requests\": [{\"textToColumns\": {\"source\": {\"startRowIndex\": 0, \"endRowIndex\": 3, \"startColumnIndex\": 0, \"endColumnIndex\": 1, \"sheetId\": 0}, \"delimiterType\": \"COMMA\"}}]}", + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "169" + ], + "Content-Type": [ + "application/json" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:30 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "97" + ] + }, + "body": { + "string": "{\n \"spreadsheetId\": \"1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI\",\n \"replies\": [\n {}\n ]\n}\n" + } + } + }, + { + "request": { + "method": "GET", + "uri": "https://sheets.googleapis.com/v4/spreadsheets/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI/values/%27Sheet1%27%21A1%3AC3", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 200, + "message": "OK" + }, + "headers": { + "x-l2-request-path": [ + "l2-managed-6" + ], + "Date": [ + "Sun, 22 Jun 2025 15:02:31 GMT" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin", + "X-Origin", + "Referer" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Content-Type": [ + "application/json; charset=UTF-8" + ], + "Server": [ + "ESF" + ], + "X-XSS-Protection": [ + "0" + ], + "content-length": [ + "251" + ] + }, + "body": { + "string": "{\n \"range\": \"Sheet1!A1:C3\",\n \"majorDimension\": \"ROWS\",\n \"values\": [\n [\n \"caf\u00e9\",\n \"na\u00efve\",\n \"r\u00e9sum\u00e9\"\n ],\n [\n \"\u5317\u4eac\",\n \"\u6771\u4eac\",\n \"\uc11c\uc6b8\"\n ],\n [\n \"\ud83c\udf4e\",\n \"\ud83c\udf4c\",\n \"\ud83c\udf52\"\n ]\n ]\n}\n" + } + } + }, + { + "request": { + "method": "DELETE", + "uri": "https://www.googleapis.com/drive/v3/files/1mA4e4F-TZWIqGQeRv-xfpiKER3ekSc6fBnj_NuwD-YI?supportsAllDrives=True", + "body": null, + "headers": { + "User-Agent": [ + "python-requests/2.32.4" + ], + "Accept-Encoding": [ + "gzip, deflate" + ], + "Accept": [ + "*/*" + ], + "Connection": [ + "keep-alive" + ], + "Content-Length": [ + "0" + ], + "authorization": [ + "" + ] + } + }, + "response": { + "status": { + "code": 204, + "message": "No Content" + }, + "headers": { + "Date": [ + "Sun, 22 Jun 2025 15:02:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "X-Frame-Options": [ + "SAMEORIGIN" + ], + "Vary": [ + "Origin, X-Origin" + ], + "Alt-Svc": [ + "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Cache-Control": [ + "no-cache, no-store, max-age=0, must-revalidate" + ], + "Content-Type": [ + "text/html" + ], + "Server": [ + "ESF" + ], + "Expires": [ + "Mon, 01 Jan 1990 00:00:00 GMT" + ], + "X-XSS-Protection": [ + "0" + ], + "Content-Length": [ + "0" + ] + }, + "body": { + "string": "" + } + } + } + ] +} From cd859b423442bb870a6b5aa23cf8b2fb123a0504 Mon Sep 17 00:00:00 2001 From: alifeee Date: Thu, 26 Jun 2025 13:43:16 +0100 Subject: [PATCH 7/8] run `tox -e format` --- gspread/worksheet.py | 2 +- tests/worksheet_test.py | 59 ++++++++++++++--------------------------- 2 files changed, 21 insertions(+), 40 deletions(-) diff --git a/gspread/worksheet.py b/gspread/worksheet.py index 88870853f..27090c1d5 100644 --- a/gspread/worksheet.py +++ b/gspread/worksheet.py @@ -35,6 +35,7 @@ from .urls import WORKSHEET_DRIVE_URL from .utils import ( DateTimeOption, + DelimiterType, Dimension, GridRangeType, InsertDataOption, @@ -62,7 +63,6 @@ numericise_all, rowcol_to_a1, to_records, - DelimiterType, ) if TYPE_CHECKING is True: diff --git a/tests/worksheet_test.py b/tests/worksheet_test.py index 85aa2ba4c..633b7a8c6 100644 --- a/tests/worksheet_test.py +++ b/tests/worksheet_test.py @@ -2013,7 +2013,7 @@ def test_text_to_column_comma_delimiter(self): test_data = [ ["apple,banana,cherry"], ["red,blue,green"], - ["one,two,three,four"] + ["one,two,three,four"], ] self.sheet.update(test_data, "A1:A3") @@ -2029,23 +2029,24 @@ def test_text_to_column_comma_delimiter(self): expected_data = [ ["apple", "banana", "cherry"], ["red", "blue", "green"], - ["one", "two", "three", "four"] + ["one", "two", "three", "four"], ] self.assertEqual(result_data, expected_data) - @pytest.mark.vcr() def test_text_to_column_custom_delimiter_pipe(self): test_data = [ ["apple|banana|cherry"], ["red|blue|green"], - ["one|two|three|four"] + ["one|two|three|four"], ] self.sheet.update(test_data, "A1:A3") - response = self.sheet.text_to_column("A1:A3", utils.DelimiterType.custom, custom_delimiter="|") + response = self.sheet.text_to_column( + "A1:A3", utils.DelimiterType.custom, custom_delimiter="|" + ) self.assertIn("spreadsheetId", response) self.assertIn("replies", response) @@ -2056,7 +2057,7 @@ def test_text_to_column_custom_delimiter_pipe(self): expected_data = [ ["apple", "banana", "cherry", ""], ["red", "blue", "green", ""], - ["one", "two", "three", "four"] + ["one", "two", "three", "four"], ] self.assertEqual(result_data, expected_data) @@ -2064,11 +2065,7 @@ def test_text_to_column_custom_delimiter_pipe(self): @pytest.mark.vcr() def test_text_to_column_autodetect_delimiter(self): # Test autodetect with consistent comma delimiters - test_data = [ - ["apple,banana,cherry"], - ["red,blue,green"], - ["one,two,three"] - ] + test_data = [["apple,banana,cherry"], ["red,blue,green"], ["one,two,three"]] self.sheet.update(test_data, "A1:A3") @@ -2085,17 +2082,14 @@ def test_text_to_column_autodetect_delimiter(self): expected_data = [ ["apple", "banana", "cherry"], ["red", "blue", "green"], - ["one", "two", "three"] + ["one", "two", "three"], ] self.assertEqual(result_data, expected_data) @pytest.mark.vcr() def test_text_to_column_with_cast_to_a1_notation(self): - test_data = [ - ["apple,banana"], - ["red,blue"] - ] + test_data = [["apple,banana"], ["red,blue"]] self.sheet.update(test_data, "A1:A2") @@ -2109,10 +2103,7 @@ def test_text_to_column_with_cast_to_a1_notation(self): # Verify the split worked result_data = self.sheet.get("A1:B2", pad_values=True) - expected_data = [ - ["apple", "banana"], - ["red", "blue"] - ] + expected_data = [["apple", "banana"], ["red", "blue"]] self.assertEqual(result_data, expected_data) @@ -2121,7 +2112,9 @@ def test_text_to_column_invalid_range_multiple_columns(self): with self.assertRaises(ValueError) as context: self.sheet.text_to_column("A1:B1", utils.DelimiterType.comma) - self.assertIn("Source range must span exactly one column", str(context.exception)) + self.assertIn( + "Source range must span exactly one column", str(context.exception) + ) self.assertIn("Got range spanning 2 columns", str(context.exception)) def test_text_to_column_custom_delimiter_missing(self): @@ -2133,11 +2126,7 @@ def test_text_to_column_custom_delimiter_missing(self): @pytest.mark.vcr() def test_text_to_column_empty_cells(self): - test_data = [ - ["apple,banana"], - [""], # Empty cell - ["red,blue"] - ] + test_data = [["apple,banana"], [""], ["red,blue"]] # Empty cell self.sheet.update(test_data, "A1:A3") @@ -2153,7 +2142,7 @@ def test_text_to_column_empty_cells(self): expected_data = [ ["apple", "banana"], ["", ""], # Empty cell should remain empty - ["red", "blue"] + ["red", "blue"], ] self.assertEqual(result_data, expected_data) @@ -2163,7 +2152,7 @@ def test_text_to_column_no_delimiter_found(self): test_data = [ ["apple"], # No delimiter ["banana"], # No delimiter - ["cherry"] # No delimiter + ["cherry"], # No delimiter ] self.sheet.update(test_data, "A1:A3") @@ -2177,21 +2166,13 @@ def test_text_to_column_no_delimiter_found(self): # When no delimiter is found, text should remain in original column result_data = self.sheet.get("A1:A3") - expected_data = [ - ["apple"], - ["banana"], - ["cherry"] - ] + expected_data = [["apple"], ["banana"], ["cherry"]] self.assertEqual(result_data, expected_data) @pytest.mark.vcr() def test_text_to_column_with_unicode_text(self): - test_data = [ - ["café,naïve,résumé"], - ["北京,東京,서울"], - ["🍎,🍌,🍒"] - ] + test_data = [["café,naïve,résumé"], ["北京,東京,서울"], ["🍎,🍌,🍒"]] self.sheet.update(test_data, "A1:A3") @@ -2207,7 +2188,7 @@ def test_text_to_column_with_unicode_text(self): expected_data = [ ["café", "naïve", "résumé"], ["北京", "東京", "서울"], - ["🍎", "🍌", "🍒"] + ["🍎", "🍌", "🍒"], ] self.assertEqual(result_data, expected_data) From 4292e133a108d1d93c5471ab006b796e943da3f0 Mon Sep 17 00:00:00 2001 From: alifeee Date: Thu, 26 Jun 2025 13:45:10 +0100 Subject: [PATCH 8/8] do not check for spelling in test cassettes that would be silly --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a4495eb89..26a653500 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ profile=black description = Run code linters deps = -r lint-requirements.txt commands = black --check --diff --extend-exclude="./env|gspread/__init__.py" . - codespell --skip=".tox,.git,./docs/build,.mypy_cache,./env" . + codespell --skip=".tox,.git,./docs/build,.mypy_cache,./env,./tests/cassettes" . flake8 . isort --check-only . mypy --install-types --non-interactive --ignore-missing-imports ./gspread ./tests