fix(ingest/redshift): replace r'\n' with '\n' to avoid token error redshift serverless… (#11111)

This commit is contained in:
AndreasHegerNuritas 2024-08-08 16:38:16 +01:00 committed by GitHub
parent e08412e513
commit a4a887c866
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -504,7 +504,11 @@ class RedshiftDataDictionary:
yield AlterTableRow(
transaction_id=row[field_names.index("transaction_id")],
session_id=session_id,
query_text=row[field_names.index("query_text")],
# See https://docs.aws.amazon.com/redshift/latest/dg/r_STL_QUERYTEXT.html
# for why we need to replace the \n with a newline.
query_text=row[field_names.index("query_text")].replace(
r"\n", "\n"
),
start_time=row[field_names.index("start_time")],
)
rows = cursor.fetchmany()