Don't format URL in the name
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -105,14 +105,20 @@ func FormatParquetName(path string) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceName = strings.ReplaceAll(sourceName, "_", " ")
|
formattedSourceName := ""
|
||||||
sourceWords := strings.Fields(sourceName)
|
if strings.Contains(sourceName, ".") { // If it's an URL
|
||||||
for i, word := range sourceWords {
|
sourceName = strings.ReplaceAll(sourceName, "_", "-")
|
||||||
if len(word) > 0 {
|
formattedSourceName = sourceName
|
||||||
sourceWords[i] = strings.ToUpper(string(word[0])) + word[1:]
|
} 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 {
|
if len(blocks) > 0 {
|
||||||
return fmt.Sprintf("%s (%s)", formattedSourceName, strings.Join(blocks, ", "))
|
return fmt.Sprintf("%s (%s)", formattedSourceName, strings.Join(blocks, ", "))
|
||||||
|
|||||||
Reference in New Issue
Block a user