Open gamerf opened 6 months ago
BTW,
The way I resolved this for the customer was by doing a SED on the exported files before importing the content
from sedpy import sedpy
def read_s3(context, filename):
resource = boto3.resource('s3')
bucket = resource.Bucket(get_s3_bucket(context))
tempfile = f"/tmp/{filename}"
try:
bucket.download_file(S3_KEY + filename, tempfile)
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "404":
return None
else:
raise
else:
sedpy.replace("'", "\"\"", tempfile)
return tempfile
There might be a more elegant way to fix this problem
Thank you, @gamerf for reporting the issue and providing a workaround. We will investigate this further and include a fix soon.
If a task_instance export has a json object on next_kwargs field, the mwaa_export.py writes the object as a string with single quotes (i.e. "{'var': {}, 'type': 'dict'}")
The mwaa_import.py COPY command, for json objects is expecting the field in the following format: {"var": {}, "type": "dict"}
as result, the import fails with the following error: