Skip to content

Commit

Permalink
Fix the import error for python3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala committed Jan 25, 2024
1 parent 6aca683 commit e7daa99
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/airflow/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from unittest import mock

import pytest
from spark_on_k8s.airflow.operators import SparkOnK8SOperator
from spark_on_k8s.client import ExecutorInstances, PodResources

from conftest import PYTHON_312

Expand All @@ -13,6 +11,9 @@
class TestSparkOnK8SOperator:
@mock.patch("spark_on_k8s.client.SparkOnK8S.submit_app")
def test_execute(self, mock_submit_app):
from spark_on_k8s.airflow.operators import SparkOnK8SOperator
from spark_on_k8s.client import ExecutorInstances, PodResources

spark_app_task = SparkOnK8SOperator(
task_id="spark_application",
namespace="spark",
Expand Down Expand Up @@ -48,6 +49,9 @@ def test_execute(self, mock_submit_app):

@mock.patch("spark_on_k8s.client.SparkOnK8S.submit_app")
def test_rendering_templates(self, mock_submit_app):
from spark_on_k8s.airflow.operators import SparkOnK8SOperator
from spark_on_k8s.client import ExecutorInstances, PodResources

spark_app_task = SparkOnK8SOperator(
task_id="spark_application",
namespace="{{ template_namespace }}",
Expand Down

0 comments on commit e7daa99

Please sign in to comment.