Skip to content

Commit

Permalink
fix: replace r'\n' with '\n' to avoid token error redshift serverless…
Browse files Browse the repository at this point in the history
… ingestion
  • Loading branch information
AndreasHegerNuritas committed Aug 7, 2024
1 parent 900c259 commit bba8b59
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,11 @@ def get_alter_table_commands(
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()

0 comments on commit bba8b59

Please sign in to comment.