airbyte-source-google-sheets 0.10.0.dev202505231635__py3-none-any.whl → 0.10.0.dev202505271949__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_google_sheets-0.10.0.dev202505231635.dist-info → airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info}/METADATA +1 -1
- {airbyte_source_google_sheets-0.10.0.dev202505231635.dist-info → airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info}/RECORD +6 -6
- source_google_sheets/manifest.yaml +7 -5
- source_google_sheets/utils.py +20 -35
- {airbyte_source_google_sheets-0.10.0.dev202505231635.dist-info → airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info}/WHEEL +0 -0
- {airbyte_source_google_sheets-0.10.0.dev202505231635.dist-info → airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info}/entry_points.txt +0 -0
@@ -2,15 +2,15 @@ source_google_sheets/__init__.py,sha256=dYaZS0KrTjksk_yeSuXmNDXDsNKWctFnlZJSMgLr
|
|
2
2
|
source_google_sheets/components/__init__.py,sha256=v7odPaLdz2S_NRzExsxkk6694Vmjbplz4Z5mA4lxdkA,343
|
3
3
|
source_google_sheets/components/extractors.py,sha256=-d5hPW40ZBjU3gTUZNudayvqf1eHlveW1amwKJywDkU,9668
|
4
4
|
source_google_sheets/components/partition_routers.py,sha256=SWo1V0K10ZdWE2TQ0KuQUfue04RTyHJe1f6BOj6c96s,1265
|
5
|
-
source_google_sheets/manifest.yaml,sha256=
|
5
|
+
source_google_sheets/manifest.yaml,sha256=CuSnA8dnRMeXWfyUA6aXBvGU3mz1dJIi0HqMiks9Fd0,15938
|
6
6
|
source_google_sheets/models/__init__.py,sha256=Z-4MTpxG5t2jGhXzs4PPoIOa83zw3jRnUDx0N9Puv3s,61
|
7
7
|
source_google_sheets/models/spreadsheet.py,sha256=DEef7bWQEpY1Uqyk7RN6qLF8oxLSNzuAtHlGRmMAKQA,1112
|
8
8
|
source_google_sheets/models/spreadsheet_values.py,sha256=-XRMuuILn9JN8svHNTj6-oG8mLTZOZ5Hejy2pJ5bILk,440
|
9
9
|
source_google_sheets/run.py,sha256=eaPRcarWqkB2b2DokvI83w7rz1blmWPQCFahvCyCdSY,1887
|
10
10
|
source_google_sheets/source.py,sha256=qO1KoGdphieu7F5VgDYtrbqs56AUvMWFGNvFHP2b9Z4,778
|
11
11
|
source_google_sheets/spec.yaml,sha256=mFOiMN1IsrjyLRcjTRw7xa0b74LwkUXdVvUqau7iTXc,5709
|
12
|
-
source_google_sheets/utils.py,sha256=
|
13
|
-
airbyte_source_google_sheets-0.10.0.
|
14
|
-
airbyte_source_google_sheets-0.10.0.
|
15
|
-
airbyte_source_google_sheets-0.10.0.
|
16
|
-
airbyte_source_google_sheets-0.10.0.
|
12
|
+
source_google_sheets/utils.py,sha256=eOPrfTFBn7p80gkw4ZEQxskIrOFDj5_Fv9pCGQt4gkA,4576
|
13
|
+
airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info/METADATA,sha256=VwpBWod_jy9XLMVHO_oJrDbgGaovtT-1EYEmuRHiq4E,5385
|
14
|
+
airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
15
|
+
airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info/entry_points.txt,sha256=Dtsfjohe5IPUFyqojk49SIoP7CifCTlNLG_pgivzppo,69
|
16
|
+
airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info/RECORD,,
|
@@ -224,11 +224,11 @@ definitions:
|
|
224
224
|
path: >-
|
225
225
|
{% if config["spreadsheet_id"] | regex_search("^(https://.*)") %}{{ config["spreadsheet_id"] | regex_search("/([-\\w]{20,})([/]?)") }}{% else %}{{ config["spreadsheet_id"] }}{% endif %}?includeGridData=true&ranges={{stream_partition.sheet_id | urlencode}}!1:1&alt=json
|
226
226
|
error_handler:
|
227
|
-
type:
|
228
|
-
|
229
|
-
- type:
|
230
|
-
|
231
|
-
|
227
|
+
type: DefaultErrorHandler
|
228
|
+
backoff_strategies:
|
229
|
+
- type: ExponentialBackoffStrategy
|
230
|
+
response_filters:
|
231
|
+
$ref: "#/definitions/response_filters/single_sheet_response_error_filters"
|
232
232
|
response_filters:
|
233
233
|
expected_one_sheet:
|
234
234
|
type: HttpResponseFilter
|
@@ -320,9 +320,11 @@ definitions:
|
|
320
320
|
single_sheet_response_error_filters:
|
321
321
|
- $ref: "#/definitions/response_filters/expected_one_sheet"
|
322
322
|
- $ref: "#/definitions/response_filters/ignore_duplicate_headers"
|
323
|
+
- $ref: "#/definitions/response_filters/rate_limit"
|
323
324
|
check_operation_single_sheet_response_error_filters:
|
324
325
|
- $ref: "#/definitions/response_filters/expected_one_sheet"
|
325
326
|
- $ref: "#/definitions/response_filters/fail_duplicate_headers"
|
327
|
+
- $ref: "#/definitions/response_filters/rate_limit"
|
326
328
|
response_error_filters:
|
327
329
|
- $ref: "#/definitions/response_filters/server_error"
|
328
330
|
- $ref: "#/definitions/response_filters/forbidden"
|
source_google_sheets/utils.py
CHANGED
@@ -42,54 +42,48 @@ def experimental_name_conversion(text: str) -> str:
|
|
42
42
|
Convert name using a set of rules, for example: '1MyName' -> '_1_my_name'
|
43
43
|
Removes leading/trailing spaces, combines number-word pairs (e.g., '50th' -> '50th'),
|
44
44
|
letter-number pairs (e.g., 'Q3' -> 'Q3'), and removes special characters without adding underscores.
|
45
|
-
Spaces are converted to underscores for snake_case.
|
45
|
+
Spaces are converted to underscores for snake_case. Preserves spaces between numbers and words.
|
46
46
|
"""
|
47
|
-
|
48
|
-
|
47
|
+
# Step 1: Tokenization
|
49
48
|
tokens = []
|
50
49
|
for m in TOKEN_PATTERN.finditer(text):
|
51
50
|
if m.group("NoToken") is None:
|
52
51
|
tokens.append(m.group(0))
|
53
52
|
else:
|
54
|
-
#
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
# Process each character in NoToken match
|
54
|
+
for char in m.group(0):
|
55
|
+
if char.isspace():
|
56
|
+
tokens.append("")
|
58
57
|
|
59
|
-
#
|
58
|
+
# Step 2: Combine adjacent tokens where appropriate
|
60
59
|
combined_tokens = []
|
61
60
|
i = 0
|
62
61
|
while i < len(tokens):
|
63
|
-
|
64
|
-
|
65
|
-
combined_tokens.append(tokens[i] + tokens[i + 1])
|
62
|
+
if i + 1 < len(tokens) and tokens[i] and len(tokens[i]) == 1 and tokens[i].isupper() and tokens[i + 1] and tokens[i + 1].isdigit():
|
63
|
+
combined_tokens.append(tokens[i] + tokens[i + 1]) # e.g., "Q3"
|
66
64
|
i += 2
|
67
|
-
|
68
|
-
|
69
|
-
combined_tokens.append(tokens[i] + tokens[i + 1])
|
65
|
+
elif i + 1 < len(tokens) and tokens[i] and tokens[i].isdigit() and tokens[i + 1] and tokens[i + 1].isalpha():
|
66
|
+
combined_tokens.append(tokens[i] + tokens[i + 1]) # e.g., "80th"
|
70
67
|
i += 2
|
71
68
|
else:
|
72
|
-
|
73
|
-
if tokens[i]:
|
74
|
-
combined_tokens.append(tokens[i])
|
69
|
+
combined_tokens.append(tokens[i])
|
75
70
|
i += 1
|
76
71
|
|
77
|
-
#
|
78
|
-
while combined_tokens and combined_tokens[-1] == "":
|
79
|
-
combined_tokens.pop()
|
80
|
-
# Remove leading empty tokens to avoid leading underscores
|
72
|
+
# Step 3: Clean up empty tokens
|
81
73
|
while combined_tokens and combined_tokens[0] == "":
|
82
74
|
combined_tokens.pop(0)
|
83
|
-
|
75
|
+
while combined_tokens and combined_tokens[-1] == "":
|
76
|
+
combined_tokens.pop()
|
84
77
|
if len(combined_tokens) >= 3:
|
85
78
|
combined_tokens = combined_tokens[:1] + [t for t in combined_tokens[1:-1] if t] + combined_tokens[-1:]
|
86
79
|
|
80
|
+
# Step 4: Handle leading digits
|
87
81
|
if combined_tokens and combined_tokens[0].isdigit():
|
88
82
|
combined_tokens.insert(0, "")
|
89
83
|
|
90
|
-
|
91
|
-
|
92
|
-
return
|
84
|
+
# Step 5: Join and convert to lowercase
|
85
|
+
result = DEFAULT_SEPARATOR.join(combined_tokens)
|
86
|
+
return result.lower()
|
93
87
|
|
94
88
|
|
95
89
|
def safe_name_conversion(text: str) -> str:
|
@@ -101,21 +95,12 @@ def safe_name_conversion(text: str) -> str:
|
|
101
95
|
return new
|
102
96
|
|
103
97
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
def experimental_safe_name_conversion(text: str, output_file: str = "conversion_results2.csv") -> str:
|
98
|
+
def experimental_safe_name_conversion(text: str) -> str:
|
108
99
|
if not text:
|
109
100
|
return text
|
110
101
|
new = experimental_name_conversion(text)
|
111
102
|
if not new:
|
112
103
|
raise Exception(f"initial string '{text}' converted to empty")
|
113
|
-
|
114
|
-
# Write to CSV
|
115
|
-
with open(output_file, mode="a", newline="", encoding="utf-8") as file:
|
116
|
-
writer = csv.writer(file)
|
117
|
-
writer.writerow([text, new]) # Write the original and converted text
|
118
|
-
|
119
104
|
return new
|
120
105
|
|
121
106
|
|
File without changes
|