Don't format URL in the name

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-09-28 23:12:35 +02:00
parent 30e5f91ed9
commit d7ee3e82c8

View File

@@ -105,14 +105,20 @@ func FormatParquetName(path string) string {
}
}
sourceName = strings.ReplaceAll(sourceName, "_", " ")
sourceWords := strings.Fields(sourceName)
for i, word := range sourceWords {
if len(word) > 0 {
sourceWords[i] = strings.ToUpper(string(word[0])) + word[1:]
formattedSourceName := ""
if strings.Contains(sourceName, ".") { // If it's an URL
sourceName = strings.ReplaceAll(sourceName, "_", "-")
formattedSourceName = sourceName
} else { // Else
sourceName = strings.ReplaceAll(sourceName, "_", " ")
sourceWords := strings.Fields(sourceName)
for i, word := range sourceWords {
if len(word) > 0 {
sourceWords[i] = strings.ToUpper(string(word[0])) + word[1:]
}
}
formattedSourceName = strings.Join(sourceWords, " ")
}
formattedSourceName := strings.Join(sourceWords, " ")
if len(blocks) > 0 {
return fmt.Sprintf("%s (%s)", formattedSourceName, strings.Join(blocks, ", "))