Content-Length: 332048 | pFad | http://github.com/apache/airflow/pull/50914

4D feat:change logLevel for XCOM returned value message for K8sPodOperator by kempspo · Pull Request #50914 · apache/airflow · GitHub
Skip to content

feat:change logLevel for XCOM returned value message for K8sPodOperator #50914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kempspo
Copy link

@kempspo kempspo commented May 21, 2025


closes: #50892
related: #18264

Description

Having exactly the same context as #18264, we want to be able to avoid returning large XComs in the log especially when using custom XCom backends.

This PR just follows the existing pattern of the PythonOperator to silence the log.

Honestly, unsure of how to write the test for this one though.

@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels May 21, 2025
Copy link

boring-cyborg bot commented May 21, 2025

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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits 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 Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment 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 for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    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

@@ -233,6 +233,10 @@ class KubernetesPodOperator(BaseOperator):
:param logging_interval: max time in seconds that task should be in deferred state before
resuming to fetch the latest logs. If ``None``, then the task will remain in deferred state until pod
is done, and no logs will be visible until that time.
:param show_return_value_in_logs: a bool value whether to show return_value logs. Defaults to True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want this set in BaseOperator (similar to do_xcom_push)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That definitely makes more sense to me. I can change the implementation to that instead, if it's what we want.

Copy link
Contributor

@eladkal eladkal May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so but lets do that in a separate PR as BaseOperator is in airlfow-core so all operators will get it only when their min version of Airflow would be 3.1.0 thus in the meantime we will need this PR (with some modification/TODO for the needed changes when min version is 3.1)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, out of curiosity the xcom is shown in the UI. Is there extra value to show it also in the logs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, out of curiosity the xcom is shown in the UI. Is there extra value to show it also in the logs?

Yeah, it does show up in the logs because of this line I believe. I followed the implementation in the PythonOperator PR because of this line

XCom logs are currently using the INFO level in python.py level logging. Many users are using INFO level loggers, so it is not possible to change the logging level to obscure the XCom logs.

So it'd look something like this

...
{pod.py:592} INFO - xcom result: 
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable XCom log for return value for KubernetesPodOperator
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/airflow/pull/50914

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy