You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/27 19:53:10 UTC

[GitHub] [airflow] jakubno opened a new pull request, #23301: Fix: Exception when parsing log #20966

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

   Took after #21053 due to inactivity
   
   >When the task outputs some strange characters, decoding will lead to "UnicodeDecodeError" error due to inconsistent encoding. We can try-catch it or ignore it by specifying the parameter: errors="backslashreplace" .
   e.g.
   
               line = ''
               for raw_line in iter(self.sub_process.stdout.readline, b''):
                   try:
                       line = raw_line.decode(output_encoding).rstrip()
                   except UnicodeDecodeError as err:
                       print(err, output_encoding, raw_line)
                   self.log.info("%s", line)
   >closes: https://github.com/apache/airflow/issues/20966


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #23301:
URL: https://github.com/apache/airflow/pull/23301#issuecomment-1122658040

   > This PR is partially providers and partially core so I'm setting also 2.3.1 milestone @potiuk will it make it on time to the providers wave today?
   
   I am waiting for few more comments on few PRs so - yeah possible.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk merged pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
potiuk merged PR #23301:
URL: https://github.com/apache/airflow/pull/23301


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #23301:
URL: https://github.com/apache/airflow/pull/23301#discussion_r864380307


##########
tests/hooks/test_subprocess.py:
##########
@@ -96,3 +96,9 @@ def test_should_exec_subprocess(self, mock_popen, mock_temporary_directory):
             stderr=STDOUT,
             stdout=PIPE,
         )
+
+    def test_task_decode(self):
+        hook = SubprocessHook()
+        command=['bash', '-c', "source "+__file__[:-2]+'sh']
+        result = hook.run_command(command=command)
+        assert result.exit_code==0

Review Comment:
   What does this test?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] jakubno commented on pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
jakubno commented on PR #23301:
URL: https://github.com/apache/airflow/pull/23301#issuecomment-1122649163

   The failed tests didn't seem to be caused by the PR, it was caused by conflicting requirements. So I rebased the branch on main


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] uranusjr commented on a diff in pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
uranusjr commented on code in PR #23301:
URL: https://github.com/apache/airflow/pull/23301#discussion_r864382377


##########
tests/hooks/test_subprocess.py:
##########
@@ -96,3 +96,9 @@ def test_should_exec_subprocess(self, mock_popen, mock_temporary_directory):
             stderr=STDOUT,
             stdout=PIPE,
         )
+
+    def test_task_decode(self):
+        hook = SubprocessHook()
+        command=['bash', '-c', "source "+__file__[:-2]+'sh']
+        result = hook.run_command(command=command)
+        assert result.exit_code==0

Review Comment:
   Instead of needing a separate script, I think you can just use `sys.executable` to print some weird characters.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] jakubno commented on a diff in pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
jakubno commented on code in PR #23301:
URL: https://github.com/apache/airflow/pull/23301#discussion_r867729738


##########
tests/hooks/test_subprocess.py:
##########
@@ -96,3 +96,9 @@ def test_should_exec_subprocess(self, mock_popen, mock_temporary_directory):
             stderr=STDOUT,
             stdout=PIPE,
         )
+
+    def test_task_decode(self):
+        hook = SubprocessHook()
+        command=['bash', '-c', "source "+__file__[:-2]+'sh']
+        result = hook.run_command(command=command)
+        assert result.exit_code==0

Review Comment:
   Simplified the test, so the script isn't needed anymore



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #23301:
URL: https://github.com/apache/airflow/pull/23301#issuecomment-1111418676

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] eladkal commented on pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
eladkal commented on PR #23301:
URL: https://github.com/apache/airflow/pull/23301#issuecomment-1122654320

   This PR is partially providers and partially core so I'm setting also 2.3.1 milestone
   @potiuk will it make it on time to the providers wave today?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] github-actions[bot] commented on pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #23301:
URL: https://github.com/apache/airflow/pull/23301#issuecomment-1122663507

   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on pull request #23301: Fix: Exception when parsing log #20966

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #23301:
URL: https://github.com/apache/airflow/pull/23301#issuecomment-1122841919

   Awesome work, congrats on your first merged pull request!
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org