Reputation: 99
I have a code that converts DataFrame to DynamicFrame and I get this weird error when trying to execute return statement, any clues what's going on?
Error:
{AttributeError}'str' object has no attribute '_jvm'
# record is DynamicFrame
def extractCustomFields(record, ctx):
rec = record.toDF()
rec = rec.withColumn("lastname", rec["customfields"][0].value)
rec.show()
return DynamicFrame.fromDF(rec, ctx, "recordTransform")
Upvotes: 0
Views: 2938
Reputation: 7028
fromDF()
expects the GlueContext as second argument. You need to pass that:
return DynamicFrame.fromDF(rec, ctx, "recordTransform")
Upvotes: 1