asaf400 edited a comment on issue #18874:
URL: https://github.com/apache/airflow/issues/18874#issuecomment-939575041


   All the GitHub perm links I have published here are LATEST main/master 
branches of each repository,
   therefore I actually think that I have done my due diligence enough to say 
the code doesn't seem to have changed from airflow 2.0.2 to airflow 2.1+, and 
that the issue would be just the same in new versions of airflow..
   
   I myself am using 2.0.2 because that's what the MWAA over at AWS have 
enabled so far..
   I have full respect for everyone officially involved in airflow development,
   
   But even taking the most recent chunk of code from docker.py file in 
airflow's docker provider, you can see that this isn't fixed yet, and airflow 
component tests for this provider? I have no idea how they pass this feature 
test, it looks like the correct behavior is asserted, but in the 'real' world, 
it just doesn't compile:
   
   
https://github.com/apache/airflow/commit/cd3307ff2147b170dc3feb5999edf5c8eebed4ba#diff-942f75ae382d164822ff30e8138471be26102283dfcbf25e6f1c8e5795de0cb0R463
   
   Code to replicate airflow's use of docker-py:
   ```
   from docker import APIClient
   d = APIClient()
   c = d.create_container(image='ubuntu:20.04', name='TEST', command="""bash -c 
"echo 'test' && echo 'test2'" """, 
host_config=d.create_host_config(auto_remove=False, network_mode='bridge'))
   lines = d.attach(container=c['Id'], stdout=True, stderr=True, stream=True)
   d.start(c['Id'])
   line = ''
   res_lines = []
   for line in lines:
       if hasattr(line, 'decode'):
           # Note that lines returned can also be byte sequences so we have to 
handle decode here
           line = line.decode('utf-8')
       line = line.strip()
       res_lines.append(line)
   
   result = d.wait(c['Id'])
   d.remove_container(c['Id'])
   print(line)
   ```
   
   as per documentation and the pytest unittest, the output should be
   `test2` right?
   
   but it isn't, It's actually both
   ```test
   test2```
   
   Edits:
   - Code chunk formatting


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