mr1holmes opened a new pull request, #40705:
URL: https://github.com/apache/airflow/pull/40705

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   closes: #40571
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   Context:
   tqdm uses carriage return to perform in-place update to its progress bar.
   
   Here's a single raw log line generated when using tqdm,
   ```
   b'2024-07-09T19:07:04.587918327Z \r  0%|          | 0/1000 [00:00<?, 
?it/s]\r  0%|          | 1/1000 [00:00<01:40,  9.98it/s]\r  0%|          | 
2/1000 [00:00<01:40,  9.98it/s]\r  0%|          | 3/1000 [00:00<01:39,  
9.97it/s]\r  0%|          | 4/1000 [00:00<01:39,  9.97it/s]\r  0%|          | 
5/1000 [00:00<01:39,  9.97it/s]\r  1%|          | 6/1000 [00:00<01:39,  
9.97it/s]\r  1%||
   ```
   
   Since we use 
[splitlines()](https://github.com/apache/airflow/blob/cf1278c9ca6390fbafe7db94c2d89e6bec172a02/airflow/providers/docker/operators/docker_swarm.py#L210)
 on the decoded logs string to split logs in lines, it gets following lines as 
different log lines in logs
   ```
   ['2024-07-09T19:07:04.587918327Z', '  0%|          | 0/1000 [00:00<?, 
?it/s]', ...]
   ```
   
   Which leads to failure in finding timestamp in carriage return separated 
lines.
   
   This PR changes the initial log pre-processing.
   Since the log generator provided by self.cli.service_logs is already 
separating log lines we just need to decode the log lines.
   


-- 
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]

Reply via email to