Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

Fix field names and deprecated AssetBatch constructor #60

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class CSVReader @JvmOverloads constructor(path: String, fieldSeparator: Char = '
// Initialize a new AssetBatch for each parallel thread
batchMap[id] = AssetBatch(
Atlan.getDefaultClient(),
"asset",
batchSize,
true,
AssetBatch.CustomMetadataHandling.MERGE,
Expand All @@ -90,7 +89,6 @@ class CSVReader @JvmOverloads constructor(path: String, fieldSeparator: Char = '
deferDeletes[id] = ConcurrentHashMap()
relatedMap[id] = AssetBatch(
Atlan.getDefaultClient(),
"related",
batchSize,
true,
AssetBatch.CustomMetadataHandling.MERGE,
Expand Down
2 changes: 1 addition & 1 deletion serde/src/main/kotlin/xformers/cell/AssetRefXformer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object AssetRefXformer {
return when (fieldName) {
"readme" -> Readme._internal().description(assetRef).build()
"links" -> Atlan.getDefaultClient().readValue(assetRef, Link::class.java)
"meanings" -> AssignedTermXformer.decode(assetRef, fieldName)
"assignedTerms" -> AssignedTermXformer.decode(assetRef, fieldName)
else -> {
val tokens = assetRef.split(TYPE_QN_DELIMITER)
val typeName = tokens[0]
Expand Down
4 changes: 1 addition & 3 deletions serde/src/main/kotlin/xformers/cell/AssignedTermXformer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ object AssignedTermXformer {
*/
fun decode(assetRef: String, fieldName: String): Asset {
return when (fieldName) {
"meanings" -> {
TermCache.getByIdentity(assetRef)?.trimToReference()!!
}
"assignedTerms" -> TermCache.getByIdentity(assetRef)?.trimToReference()!!
else -> AssetRefXformer.decode(assetRef, fieldName)
}
}
Expand Down