Skip to content

Commit

Permalink
Merge pull request #1206 from atlanhq/FT-905
Browse files Browse the repository at this point in the history
Fixes case-sensitivity of connector type on import packages
  • Loading branch information
cmgrote authored Jan 10, 2025
2 parents f3f1a66 + a3acca3 commit 104d898
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface AssetResolver {
fun getConnectionIdentityFromQN(agnosticQualifiedName: String): ConnectionIdentity? {
val tokens = agnosticQualifiedName.split("/")
return if (tokens.size > 1) {
ConnectionIdentity(tokens[0], tokens[1])
ConnectionIdentity(tokens[0], tokens[1].lowercase())
} else {
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ abstract class AssetImporter(
when (typeName) {
Connection.TYPE_NAME -> {
val connection = CSVXformer.trimWhitespace(row[header.indexOf(Asset.CONNECTION_NAME.atlanFieldName)])
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)])
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)]).lowercase()
parent = null
unique = ConnectionIdentity(connection, connector).toString()
partial = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ object Importer {
}
if (connectionIdentity == null) {
val name = row.getOrNull(header.indexOf("connectionName"))
val type = row.getOrNull(header.indexOf("connectorType"))
val type = row.getOrNull(header.indexOf("connectorType"))?.lowercase()
if (name != null && type != null) {
connectionIdentity = AssetResolver.ConnectionIdentity(name, type)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AssetTransformer(
inputRow: Map<String, String>,
prefix: String,
): String {
val connectorType = inputRow["$prefix $CONNECTOR"] ?: ""
val connectorType = inputRow["$prefix $CONNECTOR"]?.lowercase() ?: ""
val connectionName = inputRow["$prefix $CONNECTION"] ?: ""
val connectionId = AssetResolver.ConnectionIdentity(connectionName, connectorType)
return ctx.connectionCache.getIdentityMap().getOrDefault(connectionId, "")
Expand Down Expand Up @@ -117,7 +117,7 @@ class AssetTransformer(
assetQN,
inputRow["$prefix $TYPE"] ?: "",
inputRow["$prefix $NAME"] ?: "",
inputRow["$prefix $CONNECTOR"] ?: "",
inputRow["$prefix $CONNECTOR"]?.lowercase() ?: "",
connectionQN,
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class LineageTransformer(
if (source !is ICatalog || target !is ICatalog) {
logger.warn { "Source and/or target asset are not subtypes of Catalog, and therefore cannot exist in lineage: $inputRow" }
} else {
val xformConnector = inputRow[XFORM_CONNECTOR] ?: ""
val xformConnector = inputRow[XFORM_CONNECTOR]?.lowercase() ?: ""
val xformConnection = inputRow[XFORM_CONNECTION] ?: ""
val connectionId = AssetResolver.ConnectionIdentity(xformConnection, xformConnector)
val connectionQN = ctx.connectionCache.getIdentityMap().getOrDefault(connectionId, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ abstract class AssetImporter(
when (typeName) {
Connection.TYPE_NAME -> {
val connection = CSVXformer.trimWhitespace(row[header.indexOf(Asset.CONNECTION_NAME.atlanFieldName)])
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)])
val connector = CSVXformer.trimWhitespace(row[header.indexOf(ConnectionImporter.CONNECTOR_TYPE)]).lowercase()
current = ConnectionIdentity(connection, connector).toString()
parent = null
}
Expand Down

0 comments on commit 104d898

Please sign in to comment.