File tree 1 file changed +21
-26
lines changed
package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/serde/csv
1 file changed +21
-26
lines changed Original file line number Diff line number Diff line change @@ -200,36 +200,31 @@ abstract class CSVImporter(
200
200
Serde .getAssetClassForType(candidate.typeName),
201
201
field.atlanFieldName,
202
202
)
203
- val value = getter.invoke(candidate)
204
- if (value == null ||
205
- (Collection ::class .java.isAssignableFrom(value.javaClass) && (value as Collection <* >).isEmpty())
206
- ) {
207
- builder.nullField(field.atlanFieldName)
208
- return true
203
+ if (getter == null ) {
204
+ logger.warn {
205
+ " Field ${field.atlanFieldName} not known on ${candidate.typeName} -- skipping clearing it."
206
+ }
207
+ } else {
208
+ val value = getter.invoke(candidate)
209
+ if (value == null ||
210
+ (Collection ::class .java.isAssignableFrom(value.javaClass) && (value as Collection <* >).isEmpty())
211
+ ) {
212
+ builder.nullField(field.atlanFieldName)
213
+ return true
214
+ }
209
215
}
210
216
} catch (e: ClassNotFoundException ) {
211
- logger.error(
212
- " Unknown type {} — cannot clear {}." ,
213
- candidate.typeName,
214
- field.atlanFieldName,
215
- e,
216
- )
217
+ logger.error(e) {
218
+ " Unknown type ${candidate.typeName} — cannot clear ${field.atlanFieldName} ."
219
+ }
217
220
} catch (e: IllegalAccessException ) {
218
- logger.error(
219
- " Unable to clear {} on: {}::{}" ,
220
- field.atlanFieldName,
221
- candidate.typeName,
222
- candidate.qualifiedName,
223
- e,
224
- )
221
+ logger.error(e) {
222
+ " Unable to clear ${field.atlanFieldName} on: ${candidate.typeName} ::${candidate.qualifiedName} "
223
+ }
225
224
} catch (e: InvocationTargetException ) {
226
- logger.error(
227
- " Unable to clear {} on: {}::{}" ,
228
- field.atlanFieldName,
229
- candidate.typeName,
230
- candidate.qualifiedName,
231
- e,
232
- )
225
+ logger.error(e) {
226
+ " Unable to clear ${field.atlanFieldName} on: ${candidate.typeName} ::${candidate.qualifiedName} "
227
+ }
233
228
}
234
229
return false
235
230
}
You can’t perform that action at this time.
0 commit comments