Skip to content
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

Partially enable D100, D102, D103 and D104 #37469

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions airflow/api/auth/backend/kerberos_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""Kerberos authentication module."""
from __future__ import annotations

import warnings
Copy link
Collaborator Author

@rawwar rawwar Feb 16, 2024

Choose a reason for hiding this comment

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

@potiuk , pre-commit hooks reformatted this module after I moved doc string to Line 17 from Line 48. Should I revert this change?

I thought instead of merging E*s and D*s , like you mentioned, I could just fix the conflicts. Reason being, I felt E*s (at least E402) is supposed to be ignored

Copy link
Contributor

Choose a reason for hiding this comment

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

@potiuk I guess this license notice might be removed because it is already listed in https://github.com/apache/airflow/blob/main/3rd-party-licenses/LICENSE-flask-kerberos.txt


from airflow.exceptions import RemovedInAirflow3Warning
from airflow.utils.airflow_flask_app import get_airflow_app

#
# Copyright (c) 2013, Michael Komitee
# All rights reserved.
Expand All @@ -45,9 +41,9 @@
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Kerberos authentication module"""
import logging
import os
import warnings
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast

Expand All @@ -56,6 +52,8 @@
from requests_kerberos import HTTPKerberosAuth

from airflow.configuration import conf
from airflow.exceptions import RemovedInAirflow3Warning
from airflow.utils.airflow_flask_app import get_airflow_app
from airflow.utils.net import getfqdn

if TYPE_CHECKING:
Expand Down
5 changes: 2 additions & 3 deletions airflow/security/kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""Kerberos security provider."""
from __future__ import annotations

from enum import Enum

# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -34,12 +33,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Kerberos security provider."""
import logging
import shlex
import subprocess
import sys
import time
from enum import Enum

from airflow.configuration import conf
from airflow.utils.net import get_hostname
Expand Down
2 changes: 1 addition & 1 deletion airflow/security/utils.py
Copy link
Contributor

@Taragolis Taragolis Feb 16, 2024

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So, is it safe to remove from the modules? If so, I can check for all the modules where E402 is ignored and probably move the license text to a separate license file.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""Various security-related utils."""
from __future__ import annotations

# Licensed to Cloudera, Inc. under one
Expand All @@ -33,7 +34,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""Various security-related utils."""
import socket

import re2
Expand Down
Loading