Skip to content

Commit

Permalink
Drop redundant code since Airflow 3 is Python >=3.9 (apache#43563)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil authored and ellisms committed Nov 13, 2024
1 parent 0806172 commit 4ffcb4e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
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

0 comments on commit 4ffcb4e

Please sign in to comment.