AutomationDev85 commented on code in PR #43954:
URL: https://github.com/apache/airflow/pull/43954#discussion_r1840341061
##########
providers/src/airflow/providers/edge/cli/edge_command.py:
##########
@@ -248,19 +248,23 @@ def check_running_jobs(self) -> None:
logger.error("Job failed: %s", job.edge_job)
EdgeJob.set_state(job.edge_job.key,
TaskInstanceState.FAILED)
if job.logfile.exists() and job.logfile.stat().st_size >
job.logsize:
- with job.logfile.open("r") as logfile:
+ with job.logfile.open("rb") as logfile:
push_log_chunk_size = conf.getint("edge",
"push_log_chunk_size")
logfile.seek(job.logsize, os.SEEK_SET)
+ read_data = logfile.read()
+ job.logsize += len(read_data)
+ log_data = read_data.decode("utf-8", "backslashreplace")
Review Comment:
This is just to not raising exception if not matching character is in the
log file and keep the values escaped in the log.
##########
providers/src/airflow/providers/edge/cli/edge_command.py:
##########
@@ -248,19 +248,23 @@ def check_running_jobs(self) -> None:
logger.error("Job failed: %s", job.edge_job)
EdgeJob.set_state(job.edge_job.key,
TaskInstanceState.FAILED)
if job.logfile.exists() and job.logfile.stat().st_size >
job.logsize:
- with job.logfile.open("r") as logfile:
+ with job.logfile.open("rb") as logfile:
push_log_chunk_size = conf.getint("edge",
"push_log_chunk_size")
logfile.seek(job.logsize, os.SEEK_SET)
+ read_data = logfile.read()
+ job.logsize += len(read_data)
+ log_data = read_data.decode("utf-8", "backslashreplace")
Review Comment:
This is just to not raising exception if not matching character is in the
log file and keep the values escaped in the log. Removed the hard utf-8
decoding.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]