Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes case-sensitivity of connector type on import packages #1206

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixes case-sensitivity of connector type on import packages
Signed-off-by: Christopher Grote <cmgrote@users.noreply.github.com>
cmgrote committed Jan 10, 2025

Verified

This commit was signed with the committer’s verified signature.
miscco Michael Schellenberger Costa
commit a3acca351ee1709d3212d6b1e87dcb1063e52490
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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 = ""
Original file line number Diff line number Diff line change
@@ -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)
}
Original file line number Diff line number Diff line change
@@ -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, "")
@@ -117,7 +117,7 @@ class AssetTransformer(
assetQN,
inputRow["$prefix $TYPE"] ?: "",
inputRow["$prefix $NAME"] ?: "",
inputRow["$prefix $CONNECTOR"] ?: "",
inputRow["$prefix $CONNECTOR"]?.lowercase() ?: "",
connectionQN,
)
} else {
Original file line number Diff line number Diff line change
@@ -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, "")
Original file line number Diff line number Diff line change
@@ -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
}