Skip to content

Remove duplicate @staticmethod in file_task_handler.py #64477

@KengoWada

Description

@KengoWada

Apache Airflow version

3.1.8

What happened and how to reproduce it?

While reviewing the code base, I noticed that the _get_pod_namespace method is decorated with @staticmethod twice. This appears to be redundant, as applying @staticmethod once is sufficient and additional applications do not change behavior.

This does not cause a runtime error, but it introduces unnecessary duplication and may confuse readers or contributors into thinking there is a special reason for the double decoration.

Steps to reproduce

  • Navigate to the file containing _get_pod_namespace
  • Locate the method definition:
    @staticmethod
    @staticmethod
    def _get_pod_namespace(ti: TaskInstance | TaskInstanceHistory):
        ...
  • Observe that @staticmethod is applied twice to the same method.

What you think should happen instead?

This is likely an oversight introduced during a refactor or code edit. Since applying @staticmethod multiple times does not raise an error or change behavior, the duplication would not be caught by tests or linters unless specifically checked.

As a result, the redundant decorator remained in the codebase without affecting functionality, but adds unnecessary duplication and may cause confusion for readers.

Operating System

No response

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions