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

Drop redundant code since Airflow 3 is Python >=3.9 #43563

Merged
merged 1 commit into from
Oct 31, 2024
Merged
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
5 changes: 1 addition & 4 deletions airflow/utils/hashlib_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from __future__ import annotations

import hashlib
import sys
from typing import TYPE_CHECKING

if TYPE_CHECKING:
Expand All @@ -32,6 +31,4 @@ def md5(__string: ReadableBuffer = b"") -> hashlib._Hash:
:param __string: The data to hash. Default to empty str byte.
:return: The hashed value.
"""
if sys.version_info >= (3, 9):
return hashlib.md5(__string, usedforsecurity=False) # type: ignore
return hashlib.md5(__string)
return hashlib.md5(__string, usedforsecurity=False) # type: ignore
2 changes: 0 additions & 2 deletions tests/io/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# under the License.
from __future__ import annotations

import sys
import uuid
from stat import S_ISDIR, S_ISREG
from tempfile import NamedTemporaryFile
Expand Down Expand Up @@ -247,7 +246,6 @@ def test_replace(self):

e.unlink()

@pytest.mark.skipif(sys.version_info < (3, 9), reason="`is_relative_to` new in version 3.9")
def test_is_relative_to(self):
uuid_dir = f"/tmp/{str(uuid.uuid4())}"
o1 = ObjectStoragePath(f"file://{uuid_dir}/aaa")
Expand Down