Skip to content

Commit 104d898

Browse files
authored
Merge pull request #1206 from atlanhq/FT-905
Fixes case-sensitivity of connector type on import packages
2 parents f3f1a66 + a3acca3 commit 104d898

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/util/AssetResolver.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface AssetResolver {
1919
fun getConnectionIdentityFromQN(agnosticQualifiedName: String): ConnectionIdentity? {
2020
val tokens = agnosticQualifiedName.split("/")
2121
return if (tokens.size > 1) {
22-
ConnectionIdentity(tokens[0], tokens[1])
22+
ConnectionIdentity(tokens[0], tokens[1].lowercase())
2323
} else {
2424
null
2525
}

samples/packages/cube-assets-builder/src/main/kotlin/com/atlan/pkg/cab/AssetImporter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ abstract class AssetImporter(
9090
when (typeName) {
9191
Connection.TYPE_NAME -> {
9292
val connection = CSVXformer.trimWhitespace(row[header.indexOf(Asset.CONNECTION_NAME.atlanFieldName)])
93-
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)])
93+
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)]).lowercase()
9494
parent = null
9595
unique = ConnectionIdentity(connection, connector).toString()
9696
partial = ""

samples/packages/cube-assets-builder/src/main/kotlin/com/atlan/pkg/cab/Importer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ object Importer {
171171
}
172172
if (connectionIdentity == null) {
173173
val name = row.getOrNull(header.indexOf("connectionName"))
174-
val type = row.getOrNull(header.indexOf("connectorType"))
174+
val type = row.getOrNull(header.indexOf("connectorType"))?.lowercase()
175175
if (name != null && type != null) {
176176
connectionIdentity = AssetResolver.ConnectionIdentity(name, type)
177177
}

samples/packages/lineage-builder/src/main/kotlin/com/atlan/pkg/lb/AssetTransformer.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AssetTransformer(
5656
inputRow: Map<String, String>,
5757
prefix: String,
5858
): String {
59-
val connectorType = inputRow["$prefix $CONNECTOR"] ?: ""
59+
val connectorType = inputRow["$prefix $CONNECTOR"]?.lowercase() ?: ""
6060
val connectionName = inputRow["$prefix $CONNECTION"] ?: ""
6161
val connectionId = AssetResolver.ConnectionIdentity(connectionName, connectorType)
6262
return ctx.connectionCache.getIdentityMap().getOrDefault(connectionId, "")
@@ -117,7 +117,7 @@ class AssetTransformer(
117117
assetQN,
118118
inputRow["$prefix $TYPE"] ?: "",
119119
inputRow["$prefix $NAME"] ?: "",
120-
inputRow["$prefix $CONNECTOR"] ?: "",
120+
inputRow["$prefix $CONNECTOR"]?.lowercase() ?: "",
121121
connectionQN,
122122
)
123123
} else {

samples/packages/lineage-builder/src/main/kotlin/com/atlan/pkg/lb/LineageTransformer.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class LineageTransformer(
6565
if (source !is ICatalog || target !is ICatalog) {
6666
logger.warn { "Source and/or target asset are not subtypes of Catalog, and therefore cannot exist in lineage: $inputRow" }
6767
} else {
68-
val xformConnector = inputRow[XFORM_CONNECTOR] ?: ""
68+
val xformConnector = inputRow[XFORM_CONNECTOR]?.lowercase() ?: ""
6969
val xformConnection = inputRow[XFORM_CONNECTION] ?: ""
7070
val connectionId = AssetResolver.ConnectionIdentity(xformConnection, xformConnector)
7171
val connectionQN = ctx.connectionCache.getIdentityMap().getOrDefault(connectionId, "")

samples/packages/relational-assets-builder/src/main/kotlin/com/atlan/pkg/rab/AssetImporter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ abstract class AssetImporter(
9393
when (typeName) {
9494
Connection.TYPE_NAME -> {
9595
val connection = CSVXformer.trimWhitespace(row[header.indexOf(Asset.CONNECTION_NAME.atlanFieldName)])
96-
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)])
96+
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)]).lowercase()
9797
current = ConnectionIdentity(connection, connector).toString()
9898
parent = null
9999
}

0 commit comments

Comments
 (0)