You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Ironankit525 (via GitHub)" <gi...@apache.org> on 2026/03/02 20:30:08 UTC

[PR] Replace print() with proper logger in KafkaConsumerHook error_callback [airflow]

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

   **What happened:**
   In `airflow/providers/apache/kafka/src/airflow/providers/apache/kafka/hooks/consume.py`, the `error_callback` function handles errors from `confluent_kafka`. For non-authentication errors, it uses a bare `print()` statement, which bypasses Airflow's logging infrastructure.
   
   **Fix:**
   Replaced `print("Exception received: ", err)` with `log.error("Exception received from Kafka: %s", err)` using a module-level `logging.getLogger(__name__)`. This ensures errors are properly captured by Airflow's logging handlers and log aggregation systems.


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


Re: [PR] Replace print() with proper logger in KafkaConsumerHook error_callback [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #62732:
URL: https://github.com/apache/airflow/pull/62732#issuecomment-4043132520

   @Ironankit525 This PR has been converted to **draft** because it does not yet meet our [Pull Request quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
   
   **Issues found:**
   - :x: **mypy (type checking)**: Failing: CI image checks / MyPy checks (mypy-providers). Run `prek --stage manual mypy-providers --all-files` locally to reproduce. You need `breeze ci-image build --python 3.10` for Docker-based mypy. See [mypy (type checking) docs](https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#mypy-checks).
   
   > **Note:** Your branch is **333 commits behind `main`**. Some check failures may be caused by changes in the base branch rather than by your PR. Please rebase your branch and push again to get up-to-date CI results.
   
   **What to do next:**
   - The comment informs you what you need to do.
   - Fix each issue, then mark the PR as "Ready for review" in the GitHub UI - but only after making sure that all the issues are fixed.
   - Maintainers will then proceed with a normal review.
   
   Converting a PR to draft is **not** a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. If you have questions, feel free to ask on the [Airflow 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


Re: [PR] Replace print() with proper logger in KafkaConsumerHook error_callback [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #62732: Replace print() with proper logger in KafkaConsumerHook error_callback
URL: https://github.com/apache/airflow/pull/62732


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


Re: [PR] Replace print() with proper logger in KafkaConsumerHook error_callback [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #62732:
URL: https://github.com/apache/airflow/pull/62732#issuecomment-4179238994

   This pull request has been converted to draft due to quality issues more than a week ago and there has been no response from the author.
   
   **@Ironankit525**, you are welcome to reopen this PR when you are ready to continue working on it. Thank you for your contribution!
   
   <!-- Pull Request quality criteria -->


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