airbyte-source-google-sheets 0.10.0.dev202505271949__py3-none-any.whl → 0.10.0.dev202506022219__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.dev202505271949.dist-info → airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info}/METADATA +1 -1
- {airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info → airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info}/RECORD +5 -5
- source_google_sheets/utils.py +32 -9
- {airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info → airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info}/WHEEL +0 -0
- {airbyte_source_google_sheets-0.10.0.dev202505271949.dist-info → airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info}/entry_points.txt +0 -0
@@ -9,8 +9,8 @@ source_google_sheets/models/spreadsheet_values.py,sha256=-XRMuuILn9JN8svHNTj6-oG
|
|
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=4nr4MjdZa875qun2i8dyN2Y-B_QGjqShUPrvp4mJHec,5627
|
13
|
+
airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info/METADATA,sha256=NOT83ySAyrnrX7wr2Nm3FfH622KNxamaacHMb5WW64I,5385
|
14
|
+
airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
15
|
+
airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info/entry_points.txt,sha256=Dtsfjohe5IPUFyqojk49SIoP7CifCTlNLG_pgivzppo,69
|
16
|
+
airbyte_source_google_sheets-0.10.0.dev202506022219.dist-info/RECORD,,
|
source_google_sheets/utils.py
CHANGED
@@ -39,11 +39,38 @@ def name_conversion(text: str) -> str:
|
|
39
39
|
|
40
40
|
def experimental_name_conversion(text: str) -> str:
|
41
41
|
"""
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
Converts a string to a normalized, snake_case identifier for destination compatibility.
|
43
|
+
|
44
|
+
Checks Performed:
|
45
|
+
1. Removes leading and trailing spaces.
|
46
|
+
- Example: "EXAMPLE Domain " -> "example_domain"
|
47
|
+
2. Combines number-word pairs (e.g., "50th Percentile" -> "50th_percentile").
|
48
|
+
3. Removes all special characters (e.g., "Example ID*" -> "example_id").
|
49
|
+
4. Combines letter-number pairs (e.g., "Q3 2023" -> "q3_2023").
|
50
|
+
5. Preserves spaces between numbers and words as underscores.
|
51
|
+
- Example: "App Loading Milestone 1 (All)" -> "app_loading_milestone_1_all"
|
52
|
+
6. Handles sequences of special characters and spaces correctly, ensuring no extra or trailing underscores.
|
53
|
+
- Example: "Example (ID)" -> "example_id"
|
54
|
+
|
55
|
+
Additional Details:
|
56
|
+
- All output is lowercased.
|
57
|
+
- Digits are allowed at the start of the result in this version(e.g., "1MyName" -> "1my_name").
|
58
|
+
- Multiple spaces or special characters are collapsed/removed, not replaced with underscores.
|
59
|
+
- Only single underscores are used to separate tokens.
|
60
|
+
|
61
|
+
Examples:
|
62
|
+
"X9 D(a)ta" -> "x9_data"
|
63
|
+
"1MyName" -> "1my_name"
|
64
|
+
"Q3 2023" -> "q3_2023"
|
65
|
+
"EXAMPLE Domain " -> "example_domain"
|
66
|
+
"50th Percentile" -> "50th_percentile"
|
67
|
+
"Example ID*" -> "example_id"
|
68
|
+
"App Loading Milestone 1 (All)" -> "app_loading_milestone_1_all"
|
69
|
+
"Example (ID)" -> "example_id"
|
46
70
|
"""
|
71
|
+
# Remove all non-alphanumeric and non-space characters (symbols)
|
72
|
+
text = re.sub(r"[^\w\s]", "", text)
|
73
|
+
|
47
74
|
# Step 1: Tokenization
|
48
75
|
tokens = []
|
49
76
|
for m in TOKEN_PATTERN.finditer(text):
|
@@ -77,11 +104,7 @@ def experimental_name_conversion(text: str) -> str:
|
|
77
104
|
if len(combined_tokens) >= 3:
|
78
105
|
combined_tokens = combined_tokens[:1] + [t for t in combined_tokens[1:-1] if t] + combined_tokens[-1:]
|
79
106
|
|
80
|
-
# Step 4:
|
81
|
-
if combined_tokens and combined_tokens[0].isdigit():
|
82
|
-
combined_tokens.insert(0, "")
|
83
|
-
|
84
|
-
# Step 5: Join and convert to lowercase
|
107
|
+
# Step 4: Join and convert to lowercase
|
85
108
|
result = DEFAULT_SEPARATOR.join(combined_tokens)
|
86
109
|
return result.lower()
|
87
110
|
|
File without changes
|